-1

I receive errors on missing boost files but to my knowledge I already have them installed by YAST (OpenSUSE). However, I still receive the error. I need help fixing this problem.

When installation from YAST package did not work, I installed boost from source code. It still did not work. I installed boost-1.70.0

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_date_time
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_filesystem
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_system
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_regex
collect2: error: ld returned 1 exit status
make: *** [/home/hafiz/OpenFOAM/OpenFOAM-6/wmake/makefiles/general:142: /home/hafiz/OpenFOAM/hafiz-6/platforms/linux64GccDPInt64Opt/bin/laminarBuoyantSimpleSMOKE] Error 1

I would expect by installation of boost by source code, this error would get resolved but yet it's still there. boost compilation was successful as mentioned here:

...updated 184 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /home/hafiz/Softwares/boost/boost_1_70_0

The following directory should be added to linker library paths:

    /home/hafiz/Softwares/boost/boost_1_70_0/stage/lib

I'm not sure if compiler include paths and linker library paths are automatically added though. Please help resolve this issue! Thanks

Siong Thye Goh
  • 3,518
  • 10
  • 23
  • 31
hphys
  • 47
  • 6
  • As stated in the output of your boost installation, you need to tell the compiler where to find the boost include and library dirs. – Alex Hodges Jul 03 '19 at 23:29
  • @AlexHodges how do I path it? – hphys Jul 03 '19 at 23:47
  • @hphys it depends on your compiler. Which one are you using? –  Jul 03 '19 at 23:47
  • 1
    @Chipster I am using GNU compiler – hphys Jul 03 '19 at 23:59
  • Are you using Cmake? - If so, look into [Hunter](https://github.com/ruslo/hunter). You can use it to automatically build your libs, and setup all the pathing for you. – Alex Hodges Jul 04 '19 at 00:35
  • Boost is included* – Alex Hodges Jul 04 '19 at 00:37
  • 1
    When these messages say "should be added", the meaning is that *you* should do the adding. (The message would not mean "stuff happened that suggests the adding was done" -- in that case the tool would have checked and reported success or failure, not wishy-wash.) – JaMiT Jul 04 '19 at 01:22
  • @AlexHodges, hphys is trying to compile OpenFOAM packages (see the path in the last line of error message) which uses a make wrapper known as "wmake". This throws a lot of traditional solutions when using make out the window. – Eric Bringley Jul 08 '19 at 09:29

1 Answers1

0

It seems like you're using OpenFOAM and OpenSMOKE++ so you've left out a lot of important information to actually answer this question (e.g. OpenFOAM uses wmake and not make explicitly!). Despite this, I'm going to answer assuming you (1) have OpenFOAM installed already, (2) are compiling OpenSMOKE++ applications/solvers, and (3) your only problem is that wmake can't find boost that you've installed.

You need to add the boost paths to your (solver)/Make/files EXE_LIBS section for wmake to find boost:

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfvOptions \
-L$(BOOST_LIB_DIR) 

Where BOOST_LIB_DIR is an environmental variable set to /home/hafiz/Softwares/boost/boost_1_70_0/stage/lib

For more information, see the OpenFOAM User Guide Section 3.2: Compiling Applications and Libraries https://cfd.direct/openfoam/user-guide/v6-compiling-applications/#x10-710003.2

Also, stackoverflow isn't the best place for OpenFOAM -- cfd-online.com has a CFD/OpenFOAM specific forum better suited to questions like this.

Eric Bringley
  • 1,366
  • 1
  • 12
  • 21