The-OpenROAD-Project-Attic/FastRoute

Build FastRoute with newer version of tools (compiler/libs)

oharboe opened this issue · 11 comments

I have a build setup for our project that uses a Dockerfile set up under Ubuntu.

I'd like to add FastRoute and TritonRoute to this existing setup, but when I try to build FastRoute with the attached Dockerfile, it fails as below.

To reproduce, unzip the atatched openroad.zip file and run the Docker command below:

# docker build -t openroad openroad/
[deleted]
[ 99%] Building CXX object third_party/rsyn/CMakeFiles/rsyn.dir/src/script/Script.yy.cc.o
[100%] Linking CXX executable bin/rsyn
/usr/bin/ld: /FastRoute4-lefdef/third_party/rsyn/lib/linux/libliberty.a(token.o): relocation R_X86_64_32S against undefined symbol `token_q_buf' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /FastRoute4-lefdef/third_party/rsyn/lib/linux/libliberty.a(mymalloc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /FastRoute4-lefdef/third_party/rsyn/lib/linux/libliberty.a(PI.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /FastRoute4-lefdef/third_party/rsyn/lib/linux/libliberty.a(liberty_parser.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
[deleted]

openroad.zip

Hi @oharboe,

We do not officially support builds on Ubuntu (although it is possible to build).

Please consider using the same docker file from the alpha-release repository (known to work) here.

But taking a quick look in your file, our makefile does not have an "install" rule, so the last command will fail. Also, check the version of the programs/libs. For example, FastRoute4-lefdef is known to build with boost v1.58 and v1.63 and I do not know which is the default for Ubuntu 18.04 when you run apt install libboost-all-dev.

Regards,

Vitor

As a test, I changed my Dockerfile to use Ubuntu 16.04, it has boost 1.58. It builds. Dockerfile attached for reference.
openroad-ubuntu-16.04.zip

I've modified my setup to use Ubuntu 18.04 and build boost 1.63, it still fails with the same error message

Using the attached Dockerfile:

 $ docker build -t openroad openroad/
[deleted]
-- Boost version: 1.63.0
[deleted]
[100%] Linking CXX executable bin/rsyn


/usr/bin/ld: /FastRoute4-lefdef/third_party/rsyn/lib/linux/libliberty.a(token.o): relocation R_X86_64_32S against undefined symbol `token_q_buf' can not be used when making a PIE object; recompile with -fPIC

I checked: boost 1.58 failed to compile under Ubuntu 18.04.

So it would appear that the problem is not in boost as we have the same errors with two versions of boost one of them, 1.63, is known to work.

@vvbandeira Can we reopen this issue?

Although OpenROAD currently is only known to work on CentOS 6 currently, surely that can't be the ambition of OpenROAD.

I would suggest that this issue falls into an open issue category where you welcome pull requests.

Hi @oharboe, can you check if the new version in master is buildable with our setup. We removed static libs (.a) and are compiling from source.

@vvbandeira It's easier to fix code than documentation: the makefile needs to be updated to check if the submodules need to be initialized and /or updated.

$ git fetch origin
$ git clean -fdx
$ git checkout origin/master
$ make PARALLEL=12
Create build
-- FastRoute4.1 Lef/Def version
-- /home/oyvind/FastRoute4-lefdef
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Will generate lib
-- Rsyn
-- /home/oyvind/FastRoute4-lefdef/third_party/rsyn
CMake Error at third_party/rsyn/CMakeLists.txt:26 (add_subdirectory):
  The source directory

    /home/oyvind/FastRoute4-lefdef/third_party/rsyn/third_party/lef

  does not contain a CMakeLists.txt file.


CMake Error at third_party/rsyn/CMakeLists.txt:27 (add_subdirectory):
  The source directory

    /home/oyvind/FastRoute4-lefdef/third_party/rsyn/third_party/def

  does not contain a CMakeLists.txt file.


-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   filesystem
--   program_options
-- Configuring incomplete, errors occurred!
See also "/home/oyvind/FastRoute4-lefdef/build/CMakeFiles/CMakeOutput.log".
make[1]: *** No targets specified and no makefile found.  Stop.
makefile:59: recipe for target 'build' failed
make: *** [build] Error 2

@oharboe, I believe the added test in 9608000827f2ba5fb2b6d4b75a2c20c00f47ad27 solves this.

Can you test with the new version on the master branch (dd29747029fe0e4837da8696153998d5dd91aa89)?

Thanks for your feedback.

(ps. please review issue #4, as I think they are closely related)

@vvbandeira Yes: works now, even if you clone without doing it recursively.