FlexibleSUSY / FlexibleSUSY

Creates spectrum generators for supersymmetric and non-supersymmetric models
https://flexiblesusy.hepforge.org
GNU General Public License v3.0
18 stars 14 forks source link

test/test_pv_softsusy.x and test/test_pv_fflite.x have undefinde symbols #204

Closed Expander closed 4 years ago

Expander commented 4 years ago

@uukhas Building test/test_pv_softsusy.x and test/test_pv_fflite.x on travis-ci fails with a linking error. It seems that libpv.a contains symbols to a configured loop library, which is not linked.

I guess this could be resolved by linking $(LOOPFUNCLIBS) to test/test_pv_softsusy.x and test/test_pv_fflite.x. However, I'm not 100% sure if this is correct, because I could imagine that we destroy the tests if we link the wrong library (FFLITE or LoopTools), because FFLITE and LoopTools probably contain the same symbols.

Would you mind having a look how to resolve this linking issue? Maybe you could check how the linking was done before you introduced your nice dynamic selection of the loop library?

uukhas commented 4 years ago

@Expander, I am quite surprised that now these tests are failing, because at the time, when my nice dynamic selection of the loop library was merged, they were working.

In addition, I noticed, that test_looplibrary_collier.x fails as well (I think, that this might be caused by high precision requirements.

So, I will try to resolve these issues and make PR.

wkotlarski commented 4 years ago

No @uukhas. The tests were not working since the merge. We're still slowly squashing bugs :)

uukhas commented 4 years ago

No @uukhas. The tests were not working since the merge. We're still slowly squashing bugs :)

This was the first time, when these 3 tests were added and compiled here, remotely. I spent some time on that large (sorry for that) PR in order to fix these tests that time. And they were working on my machine. This is was I meant.

Expander commented 4 years ago

@uukhas , many thanks for having a look at this issue!

I have to apologize, because this maybe my mistake: Before we merged your PR, we did not properly test the new feature on travis-ci. In particular, I did not build with the flags --with-loop-libraries=looptools,collier on travis-ci. Sorry for that.

wkotlarski commented 4 years ago

Some tests fail for FS configured with LoopTools

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /FlexibleSUSY/test/libpv.a(pv.o): in function `flexiblesusy::passarino_veltman::A0(double, double)':
pv.cpp:(.text+0x26): undefined reference to `setmudim_'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: pv.cpp:(.text+0x3c): undefined reference to `aget_'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: pv.cpp:(.text+0x43): undefined reference to `ltvars_'

Is this related to this issue? @uukhas, would you mind looking at it?

Expander commented 4 years ago

@wkotlarski can you please state the exact configuration command that you'd used?

wkotlarski commented 4 years ago

Something like this

./configure --with-cxx=$CXXCOMPILER --with-math-cmd=/usr/local/Wolfram/WolframEngine/12.1/Executables/math --with-optional-modules=test --with-loop-libraries=looptools --with-looptools-libdir=/LoopTools-$LOOPTOOLS_VERSION/lib64 --with-looptools-incdir=/LoopTools-$LOOPTOOLS_VERSION/include
Expander commented 4 years ago

Ah, thanks! This is probably equivalent to

./configure --enable-looptools --with-optional-modules=test

(except for the paths).

wkotlarski commented 4 years ago

Also, with

m=SM; ./createmodel -f --name=$m && ./configure --with-cxx=g++ --with-models=$m --with-loop-libraries=collier,looptools --with-looptools-incdir=/home/wojciech/HEP-software/gcc/LoopTools-2.15/include --with-looptools-libdir=/home/wojciech/HEP-software/gcc/LoopTools-2.15/lib64 --with-optional-modules=test  --enable-colors --with-collier-incdir=/home/wojciech/HEP-software/gcc/COLLIER-1.2.4/include --with-collier-libdir=/home/wojciech/HEP-software/gcc/COLLIER-1.2.4/lib

I get

Building test/test_looplibrary_environment.x
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/9/../../../../lib64/crt1.o: in function `_start':
/home/abuild/rpmbuild/BUILD/glibc-2.31/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [test/module.mk:1257: test/test_looplibrary_environment.x] Błąd 1

Is this already known?

Expander commented 4 years ago

Ouch! Can you please print the output of

make VERBOSE=1

for the failing command?

wkotlarski commented 4 years ago
g++ -o test/test_looplibrary_environment.x  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/test_looplibrary_environment.o  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/SOFTSUSY/libSOFTSUSY.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SM/libmodel_specific_SM.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SM_thresholds/libmodel_specific_SM_thresholds.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SplitMSSM/libmodel_specific_SplitMSSM.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/MSSM_higgs/libmodel_specific_MSSM_higgs.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/MSSM_thresholds/libmodel_specific_MSSM_thresholds.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/NMSSM_higgs/libmodel_specific_NMSSM_higgs.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/libtest.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/libflexisusy.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/loop_libraries/libcollier_wrapper.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/libfortran_utils.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/libpv.a \
        -L/home/wojciech/HEP-software/gcc/COLLIER-1.2.4/lib -lcollier -L/home/wojciech/HEP-software/gcc/LoopTools-2.15/lib64 -looptools -lquadmath -lboost_unit_test_framework -lpthread -L/usr/lib64 -lgsl -lgslcblas -lm -lsqlite3  -L/usr/lib64/gcc/x86_64-suse-linux/9/ -lgfortran -lm
Expander commented 4 years ago

@uukhas fixed several linking bugs. @wkotlarski could you please try if the problems still persist?

wkotlarski commented 4 years ago

The latest version of the development branch still has this error.

Expander commented 4 years ago

I've tried to reproduce the problem. I've run:

m=SM
./createmodel -f --name=$m
./configure --with-cxx=g++ \
  --with-models=$m \
  --with-loop-libraries=collier,looptools \
  --with-looptools-incdir=$HOME/packages/LoopTools-2.15/build \
  --with-looptools-libdir=$HOME/packages/LoopTools-2.15/build \
  --with-optional-modules=test \
  --enable-colors \
  --with-collier-incdir=$HOME/packages/COLLIER-1.2.4/modules \
  --with-collier-libdir=$HOME/packages/COLLIER-1.2.4/
make VERBOSE=1

Then I get a compiler error:

Building src/loop_libraries/library_looptools.o
g++ -Iconfig -Isrc -Ifflite -Islhaea -Idoc -Imeta -Itemplates -Imodels/SM -Itest -I. -I/usr/include -I/home/avoigt/.conan/data/eigen/3.3.7/conan/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/eigen3 -DBOOST_ALL_DYN_LINK -D_GLIBCXX_USE_CXX11_ABI=1 -I/home/avoigt/.conan/data/boost/1.71.0/conan/stable/package/257e5c9842903d5f654ce1fcda7ccfe022fd0f71/include  -I/home/avoigt/packages/COLLIER-1.2.4/modules -I/home/avoigt/packages/LoopTools-2.15/build -std=c++14 -O2 -fPIC -c src/loop_libraries/library_looptools.cpp -o src/loop_libraries/library_looptools.o
In file included from src/loop_libraries/library_looptools.cpp:20:
src/loop_libraries/library_looptools.cpp: In member function ‘void flexiblesusy::looplibrary::Looptools::set_mu2_uv(double)’:
/home/avoigt/packages/LoopTools-2.15/build/clooptools.h:924:47: error: taking address of temporary array
 #define _lt_setreal_(f,x) _lt_set_(f)((REAL[]){ToREAL(x)})
                                               ^~~~~~~~~~~
/home/avoigt/packages/LoopTools-2.15/build/clooptools.h:929:21: note: in expansion of macro ‘_lt_setreal_’
 #define setmudim(x) _lt_setreal_(mudim,x)
                     ^~~~~~~~~~~~
src/loop_libraries/library_looptools.cpp:67:7: note: in expansion of macro ‘setmudim’
       setmudim(scl2_in);
       ^~~~~~~~
make: *** [Makefile:249: src/loop_libraries/library_looptools.o] Error 1

@uukhas have you seen this error before?

I've build LoopTools like so:

./configure FFLAGS="-fPIC" CFLAGS="-fPIC" CXXFLAGS="-fPIC"
make

Update:

This error happens only with g++ 8.3.0. It does not happen with clang++.

Update:

When I use clang++, I get no linking error with the setup from above.

wkotlarski commented 4 years ago

I think I saw it at some point and it might now be related to our problem. I think it was clang or LoopTools error.

Expander commented 4 years ago
g++ -o test/test_looplibrary_environment.x  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/test_looplibrary_environment.o  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/SOFTSUSY/libSOFTSUSY.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SM/libmodel_specific_SM.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SM_thresholds/libmodel_specific_SM_thresholds.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SplitMSSM/libmodel_specific_SplitMSSM.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/MSSM_higgs/libmodel_specific_MSSM_higgs.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/MSSM_thresholds/libmodel_specific_MSSM_thresholds.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/NMSSM_higgs/libmodel_specific_NMSSM_higgs.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/libtest.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/libflexisusy.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/loop_libraries/libcollier_wrapper.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/libfortran_utils.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/libpv.a \
        -L/home/wojciech/HEP-software/gcc/COLLIER-1.2.4/lib -lcollier -L/home/wojciech/HEP-software/gcc/LoopTools-2.15/lib64 -looptools -lquadmath -lboost_unit_test_framework -lpthread -L/usr/lib64 -lgsl -lgslcblas -lm -lsqlite3  -L/usr/lib64/gcc/x86_64-suse-linux/9/ -lgfortran -lm

The error "undefined reference to main" seems to suggest that test_looplibrary_environment.{x,o} do not contain a main function.

Could you please run

rm test_looplibrary_environment.{x,o}
make VERBOSE=1 test_looplibrary_environment.x

and paste the output? I have the impression that one of the build statements may have a bug.

wkotlarski commented 4 years ago
make VERBOSE=1 test/test_looplibrary_environment.x
Building test/test_looplibrary_environment.o
g++ -Iconfig -Isrc -Ifflite -Islhaea -Idoc -Imeta -Itemplates -Imodels/SM -Itest -I. -Itest/SOFTSUSY -Imodel_specific/SM -Imodel_specific/SM_thresholds -Imodel_specific/SplitMSSM -Imodel_specific/MSSM_higgs -Imodel_specific/MSSM_thresholds -Imodel_specific/NMSSM_higgs -I/usr/include -I/usr/include/eigen3 -I/usr/include  -std=c++14 -O2 -fPIC -c test/test_looplibrary_environment.cpp -o test/test_looplibrary_environment.o
Building test/test_looplibrary_environment.x
g++ -o test/test_looplibrary_environment.x  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/test_looplibrary_environment.o  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/SOFTSUSY/libSOFTSUSY.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SM/libmodel_specific_SM.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SM_thresholds/libmodel_specific_SM_thresholds.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/SplitMSSM/libmodel_specific_SplitMSSM.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/MSSM_higgs/libmodel_specific_MSSM_higgs.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/MSSM_thresholds/libmodel_specific_MSSM_thresholds.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/model_specific/NMSSM_higgs/libmodel_specific_NMSSM_higgs.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/libtest.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/libflexisusy.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/loop_libraries/libcollier_wrapper.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/src/libfortran_utils.a  /home/wojciech/Programowanie/c++/FlexibleUpstream/test/libpv.a \
        -L/home/wojciech/HEP-software/gcc/COLLIER-1.2.4/lib -lcollier -L/home/wojciech/HEP-software/gcc/LoopTools-2.15/lib64 -looptools -lquadmath -lboost_unit_test_framework -lpthread -L/usr/lib64 -lgsl -lgslcblas -lm -lsqlite3  -L/usr/lib64/gcc/x86_64-suse-linux/9/ -lgfortran -lm
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/9/../../../../lib64/crt1.o: in function `_start':
/home/abuild/rpmbuild/BUILD/glibc-2.31/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [test/module.mk:1228: test/test_looplibrary_environment.x] Błąd 1

I wonder what is this line

/home/abuild/rpmbuild/BUILD/glibc-2.31/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'

It's not my path. It looks like a path from rpm build service. Why would it be hardcoded on my system?

Expander commented 4 years ago

I think I've identified a possible cause of this issue. Could you please try with the latest commit fde19e907 ?

Expander commented 4 years ago

@uukhas Do you know if there is an alternative to setmudim(x) in LoopTools? I.e., can the scale be set in a different way?

uukhas commented 4 years ago

If I am not mistaken, this is the only way, according to manual.

Expander commented 4 years ago

@uukhas Ok, thanks. I've filed a bug report in LoopTools 2.15.

wkotlarski commented 4 years ago

I think I've identified a possible cause of this issue. Could you please try with the latest commit fde19e9 ?

For me this commit does not solve the problem, sorry.

Expander commented 4 years ago

Strange. Could you please execute the following commands and paste the output here:

nm test/test_looplibrary_environment.x | grep main

and

nm test/test_looplibrary_environment.o | grep main
wkotlarski commented 4 years ago

The .x is not created, right? So I cannot nm it. In .o there's no mention of main.

Expander commented 4 years ago

Ah, of course. :) But that means that the command

g++ -Iconfig -Isrc -Ifflite -Islhaea -Idoc -Imeta -Itemplates -Imodels/SM -Itest -I. -Itest/SOFTSUSY -Imodel_specific/SM -Imodel_specific/SM_thresholds -Imodel_specific/SplitMSSM -Imodel_specific/MSSM_higgs -Imodel_specific/MSSM_thresholds -Imodel_specific/NMSSM_higgs -I/usr/include -I/usr/include/eigen3 -I/usr/include  -std=c++14 -O2 -fPIC -c test/test_looplibrary_environment.cpp -o test/test_looplibrary_environment.o

does not create a main, but it should! If I run this command on my machine, it does not produce a main, either. However, when I add -DBOOST_ALL_DYN_LINK to the command, a main is generated:

g++ -Iconfig -Isrc -Ifflite -Islhaea -Idoc -Imeta -Itemplates -Imodels/SM -Itest -I. -Itest/SOFTSUSY -Imodel_specific/SM -Imodel_specific/SM_thresholds -Imodel_specific/SplitMSSM -Imodel_specific/MSSM_higgs -Imodel_specific/MSSM_thresholds -Imodel_specific/NMSSM_higgs -DBOOST_ALL_DYN_LINK -I/usr/include -I/usr/include/eigen3 -I/usr/include  -std=c++14 -O2 -fPIC -c test/test_looplibrary_environment.cpp -o test/test_looplibrary_environment.o

Then i get:

$ nm test/test_looplibrary_environment.o | grep main
0000000000000000 T main
                 U _ZN5boost9unit_test14unit_test_mainEPFbvEiPPc

Can you please past the output of

make print-BOOSTFLAGS
uukhas commented 4 years ago

For me it gives:

BOOSTFLAGS = -I/usr/include
Expander commented 4 years ago

I've pushed another speculative fix in commit 3339e4946 . Could you please check if the problem still persists?

uukhas commented 4 years ago

For me - the problem is solved. I only used the changes from the last commit.

uukhas commented 4 years ago

@Expander, sorry. I corrected my answer)

Expander commented 4 years ago

Thanks for your feedback! I've created a PR to add

#define BOOST_TEST_DYN_LINK

to all remaining tests that did not define it. Could you please have a look?

Expander commented 4 years ago

Interestingly, the tests that were missing a #define BOOST_TEST_DYN_LINK seem to be the one that fail with an invalid free error message on @wkotlarski 's machine.

wkotlarski commented 4 years ago

For me #208 fix the problem with test_looplibrary_environment.x. Thanks all!

Expander commented 4 years ago

Great! Good that this is resolved now!

Expander commented 4 years ago

Can we close this issue?

wkotlarski commented 4 years ago

For the test_pv_softsusy.x hangs.

uukhas commented 4 years ago

It waits for an input from test_pv_fflite.x.

It should not be called at all. Only as a part of test_pv_crosschecks.sh.

Expander commented 4 years ago

@wkotlarski Could you please paste the output of

make print-TEST_ALL_XML | tr ' ' '\n' | sort

and

make -k -d all-test

Maybe this helps us to see which target leads to this call?

wkotlarski commented 4 years ago

@Expander, it's fine. I didn't know I was not suppose to call it manually, which I did. Sorry. All is fine. We can close it.