OPM / opm-parser

http://www.opm-project.org
11 stars 44 forks source link

Prevent linker errors with shared boost unit test libs. #1215

Closed blattms closed 6 years ago

blattms commented 6 years ago

If we are using a shared boost unit test library we need to define BOOST_TEST_DYN_LINK or we will get linker error like: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function _start': (.text+0x20): undefined reference tomain' collect2: error: ld returned 1 exit status

With this commit we do this in the source files of all the tests like in other modules by checking HAVE_DYNAMIC_BOOST_TEST and if it is defined setting BOOST_TEST_DYN_LINK.

An alternative approach would be to add BOOST_TEST_DYN_LINK to the compile definitions but that would be inconsistent with the other modules. (They could do the same of course...) Closes #1213.

blattms commented 6 years ago

Travis error:

$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
The command "rake" exited with 1.
Done. Your build exited with 1.

seems unrelated.

atgeirr commented 6 years ago

An alternative approach would be to add BOOST_TEST_DYN_LINK to the compile definitions but that would be inconsistent with the other modules. (They could do the same of course...)

That solution has been merged already unless I am mistaken: OPM/opm-common#334

joakim-hove commented 6 years ago

I will close this now as another solution has already been merged.

joakim-hove commented 6 years ago

Travis error: [...]

Have removed the .travis.yml file and (tried to) disable travis building, but some setting somewhere sticks - so now it is completely broken.

atgeirr commented 6 years ago

Have removed the .travis.yml file and (tried to) disable travis building, but some setting somewhere sticks - so now it is completely broken.

I took the liberty of unchecking the Active button in the Travis settings. Hope that helps.