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

Unable to link libpthread on Mac OS 14.2.1 and Apple M2 chip #593

Closed michelelucente closed 8 months ago

michelelucente commented 8 months ago

Hi, I am trying to configure a model, but FlexibleSUSY is not able to find libpthread. I see that you already fixed this bug for version 2.4.0, so maybe this issue is related to the previous one?

Here is the terminal output:

(FS) ➜  FlexibleSUSY git:(master) ✗ ./configure --with-models="MSSM" --with-math-cmd="/Applications/Mathematica.app/Contents/MacOS/WolframKernel"         
Checking for RGE solvers ... ok (two_scale semi_analytic)
Checking for Mathematica kernel /Applications/Mathematica.app/Contents/MacOS/WolframKernel ... found /Applications/Mathematica.app/Contents/MacOS/WolframKernel
Checking for Mathematica version >= 11.0 ... ok (version 14. for MacOSX-ARM64 in /Applications/Mathematica.app/Contents)
Checking for SARAH installation ... ok (version 4.15.2)
Checking for FeynArts installation ... ok (not installed)
Checking for FormCalc installation ... ok (not installed)
Checking for models ... ok (MSSM)
Checking model makefiles
Checking model files for required third party libraries
Checking for C++ compiler g++ ... found /usr/local/bin/g++
Checking for type of C++ compiler g++ ... GNU
Checking for g++ compiler version >= 5.0.0 ... ok (version 13.0.1)
Checking for Fortran compiler gfortran ... found /opt/homebrew/bin/gfortran
Checking for LibraryLink ... yes
Checking for WolframLibrary.h ... found in /Applications/Mathematica.app/Contents/SystemFiles/IncludeFiles/C
Checking for mathlink.h ... found in /Applications/Mathematica.app/Contents/SystemFiles/Links/MathLink/DeveloperKit/MacOSX-ARM64/CompilerAdditions
Checking for libMLi4 ... found in /Applications/Mathematica.app/Contents/SystemFiles/Links/MathLink/DeveloperKit/MacOSX-ARM64/CompilerAdditions
Checking for boost/version.hpp ... found in /usr/local/include
Checking for boost version >= 1.37.0 ... ok (version 1.81.0)
Checking for boost/test/unit_test.hpp ... found in /usr/local/include
Checking for libboost_unit_test_framework libboost_unit_test_framework-mt ... found in /usr/local/lib
Checking for Eigen/Core ... found in /usr/local/include/eigen3
Checking for eigen version ... ok (version 3.4.90)
Checking for libgfortran ... found in /opt/homebrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc/aarch64-apple-darwin23/13/../../../
Checking for GSL configuration gsl-config ... found /Users/michele/miniconda3/envs/FS/bin/gsl-config (version 2.7.1)
Checking for gm2calc/gm2_version.h ... not found in 
Checking for himalaya/version.hpp ... not found in 
Checking for boost/numeric/odeint.hpp ... found in /usr/local/include
Checking for boost/numeric/odeint/algebra/algebra_dispatcher.hpp ... found in /usr/local/include
Checking for boost/numeric/odeint/algebra/vector_space_algebra.hpp ... found in /usr/local/include
Checking for boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp ... found in /usr/local/include
Checking for boost/numeric/odeint/external/eigen/eigen_resize.hpp ... found in /usr/local/include
Checking for boost/numeric/odeint/integrate/integrate_adaptive.hpp ... found in /usr/local/include
Checking for boost/numeric/odeint/stepper/generation.hpp ... found in /usr/local/include
Checking for boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp ... found in /usr/local/include
Checking for sqlite3.h ... not found in  ::/usr/include:/usr/local/include
Warning: sqlite.h not found in  ::/usr/include:/usr/local/include.
   Support for SQLite will be is disabled.
Checking for tsil.h ... not found in  ::/usr/include:/usr/local/include
Checking for build static library command ar cru ... found /usr/bin/ar
Checking for build shared library command g++ -shared -o ... found /usr/local/bin/g++
Checking for random number generator ... ok
Checking for std::thread ... ok
Checking for libpthread ... not found in :/usr/lib:/usr/local/lib:/path/to/libpthread/aarch64-apple-darwin22.4.0/13.0.1/:/path/to/libpthread/:./aarch64-apple-darwin22.4.0/13.0.1/:./:/usr/local/lib/gcc/aarch64-apple-darwin22.4.0/13.0.1/:/usr/local/lib/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../../aarch64-apple-darwin22.4.0/lib/aarch64-apple-darwin22.4.0/13.0.1/:/usr/local/lib/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../../aarch64-apple-darwin22.4.0/lib/:/usr/local/lib/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../aarch64-apple-darwin22.4.0/13.0.1/:/usr/local/lib/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../:.:/usr/local/lib/gcc/aarch64-apple-darwin22.4.0/13.0.1:/usr/local/lib/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../..::/usr/lib64:/usr/local/lib64:/path/to/libpthread/aarch64-apple-darwin22.4.0/13.0.1/:/path/to/libpthread/:::/usr/local/lib64/gcc/aarch64-apple-darwin22.4.0/13.0.1/:/usr/local/lib64/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../../aarch64-apple-darwin22.4.0/lib64/aarch64-apple-darwin22.4.0/13.0.1/:/usr/local/lib64/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../../aarch64-apple-darwin22.4.0/lib64/:/usr/local/lib64/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../aarch64-apple-darwin22.4.0/13.0.1/:/usr/local/lib64/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../../::/usr/local/lib64/gcc/aarch64-apple-darwin22.4.0/13.0.1:/usr/local/lib64/gcc/aarch64-apple-darwin22.4.0/13.0.1/../../..
Error: libpthread must be installed to enable multithreading!

Please let me know if you need further input from my side.

Thank you!

Expander commented 8 months ago

Dear @michelelucente ,

thanks for reporting this issue!

Could you please search for libpthread* on your machine? Maybe it is not installed or located in a directory where FlexibleSUSY does not search.

Alternatively, you could also disable multi-threading by ./configure --disable-threads. Then FS will not search for the threads library. :)

Best regards Alex

michelelucente commented 8 months ago

Hi Alex, I found the origin of the issue. libpthread seems to have a different name on my machine, the library is libsystem_pthread.dylib.

So I solved the issue by creating a symlink with the standard library name:

sudo ln -s /usr/lib/system/libsystem_pthread.dylib /usr/local/lib/libpthread.dylib

It works now.

Thank you for helping with that!

Expander commented 8 months ago

Ah, excellent solution! :) Anyway, thanks for reporting!