ibex-team / ibex-lib

IBEX is a C++ library for constraint processing over real numbers.
http://ibex-team.github.io/ibex-lib/
GNU Lesser General Public License v3.0
67 stars 51 forks source link

Installation impossible sur Mac osx #537

Open Waingro13 opened 9 months ago

Waingro13 commented 9 months ago

Bonjour, voila des heures que je bataille pour parvenir a utiliser cette librairie et ce que j'ai tenté :

raphaelchenouard commented 9 months ago

Bonjour, Est-ce possible d'avoir plus d'informations, sur ta configuration (mac-intel, mac-arm) ? La principale difficulté sur les mac récents (arm64) est d'adapter l'installation des dépendances d'ibex (Gaol, APMathlib et Soplex). Tu peux installer ces bibliothèques par toi-même (il y a aussi un peu de boulot, car darwin+arm64 ne sont pas bien identifiés par APMathlib et Gaol) et ensuite avec cmake tu peux indiquer les dossiers qui vont bien pour ces dépendances. Par exemple sur ma machine, j'ai fait (les dépendances sont installées dans le cellar d'homebrew) : cmake .. -DCMAKE_INSTALL_PREFIX=/opt/homebrew/Cellar/ibex/2.8.9/ -DLP_LIB=soplex -DINTERVAL_LIB=gaol -DSOPLEX_DIR=/opt/homebrew -DGAOL_DIR=/opt/homebrew/Cellar -DMATHLIB_DIR=/opt/homebrew

Je viens de voir qu'ibex était toujours dans homebrew, as-tu essayé de l'installer via ce gestionnaire ? Je n'ai pas réessayé depuis le passage aux arm64, mais avec les mac-intel ça marchait bien.

Waingro13 commented 9 months ago

Bonjour, bon j'ai au moins appris qu'il fallait préalablement installer 3 librairies pour que ça fonctionne, j'ai eu beau rechercher cette info l'autre jour, impossible de la trouver. C'est si compliqué d'ajouter un test dans le script d'install afin de rechercher ces librairies et de mettre un message d'erreur afin que l'utilisateur comprenne ce qu'il faut faire plutôt que d'installer une lib qui ne peut pas fonctionner et va générer des erreurs de compile, laissant l'utilisateur penser que c'est son programme qui est en cause ? Donc j'ai installe APMathlib sans soucis mais pour GOAL ça ne marche pas et là encore je soupçonne un bug dans le processus d'installation parce que...

MacBook-Pro-10:GAOL-master $ sudo ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking build system type... x86_64-apple-darwin17.7.0 checking host system type... x86_64-apple-darwin17.7.0 checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /opt/local/bin/ld checking if the linker (/opt/local/bin/ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 196608 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-apple-darwin17.7.0 file names to x86_64-apple-darwin17.7.0 format... func_convert_file_noop checking how to convert x86_64-apple-darwin17.7.0 file names to toolchain format... func_convert_file_noop checking for /opt/local/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... no checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... no checking if : is a manifest tool... no checking for dsymutil... dsymutil checking for nmedit... nmedit checking for lipo... lipo checking for otool... otool checking for otool64... no checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking for -force_load linker flag... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/opt/local/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin17.7.0 dyld checking how to hardcode library paths into programs... immediate checking for dlopen in -ldl... yes checking whether a program can dlopen itself... yes checking whether a statically linked program can dlopen itself... yes checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for bison... bison -y checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /opt/local/bin/ld checking if the linker (/opt/local/bin/ld) is GNU ld... no checking whether the g++ linker (/opt/local/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fno-common -DPIC checking if g++ PIC flag -fno-common -DPIC works... yes checking if g++ static flag -static works... no checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/opt/local/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin17.7.0 dyld checking how to hardcode library paths into programs... immediate checking whether SSE2 features are available... yes checking whether SSE3 features are available... yes checking for utan in -lultim... yes checking MathLib.h usability... no checking MathLib.h presence... no checking for MathLib.h... no configure: error: Header MathLib.h not found MacBook-Pro-10:GAOL-master $ ll /usr/local/include | grep MathLib.h -rw-r--r--@ 1 root admin 5187 30 nov 11:00 MathLib.h MacBook-Pro-10:GAOL-master $

Je ne sais pas où il cherche MathLib mais visiblement pas dans /usr/local alors qu'a priori ça devrait être là non ? J'ai essayé d'ajouter --includedir=/usr/local/include à configure mais sans surprise ça ne change rien puisque c'est la dir par défaut.

raphaelchenouard commented 9 months ago

Dans le processus d'installation standard, ces bibliothèques sont installées automatiquement par ibex. Il me semble que sur mac-intel ça marche bien avec cmake .. -DLP_LIB=soplex.

Concernant l'installation de gaol, pourquoi es-tu root? Essaye de faire le configure sans le sudo, car ce n'est pas sûr que le root ait les mêmes variables d'environnement que l'utilisateur standard. Question naive au cas où, as-tu vérifié que Mathlib.h était bien dans /usr/local/include ?

Waingro13 commented 9 months ago

Bon, puisque ces libs sont dans ibex pourquoi m'as-tu donne une ligne ou tu vas les chercher ailleurs ? J'ai donc detruit lesdites libs, telechargé "ibex-lib-master.zip" et repris la ligne que tu me donnes en enlevant ce qui me paraissait devoir etre enleve : sudo cmake .. -DLP_LIB=soplex -DINTERVAL_LIB=gaol -DCMAKE_INSTALL_PREFIX=/usr/local Et meme resultat que d'habitude, a savoir erreur a l'edition de liens. Juste une question comme ça : ton script impose cette m... de Apple Clang comme compilo, y compris si on le cache d'ailleurs, et je n'ai pas trouve comment imposer gcc comme compilo. J'ai perdu suffisament de jours dans ma vie a cause de cette m.... pour ne plus jamais utiliser clang, qui genere a peu tout ce qu'un compilo peut generer comme emmerdements a un developpeur. D'ailleurs mathlib utilise gcc et non clang, comme quoi les gens d'IBM ont au loins compris ça. Est-il possible d'eviter que ton script impose clang, histoire de voir si ca ne marcherait pas mieux ?

raphaelchenouard commented 9 months ago

Est-ce que tu peux utiliser un langage plus adapté, stp ?

Tu n'as toujours pas répondu à ma première question, à savoir quelle est ta configuration ?

Je suis désolé, mais tu ne sembles pas bien comprendre ce que tu es en train de faire. Si tu veux explicitement utiliser gcc à la place de clang, c'est très simple et supporté par cmake (en fait, il se contente de prendre le compilateur par défaut sur ta propre machine). La compilation de la quasi-totalité des bibliothèques C/C++ qui s'appuient sur un makefile un peu générique (donc aussi avec cmake) utilisent les variables d'environnement CC et CXX afin de définir le compilateur utilisé : https://www.gnu.org/software/make/manual/make.html#Implicit-Variables Je te laisse regarder également ici pour voir comment définir ces variables pour utiliser gcc avant de lancer cmake, ne connaissant pas ta version : https://stackoverflow.com/questions/17275348/how-to-specify-new-gcc-path-for-cmake

Si tu ne veux pas t'embêter avec tout ça, je te proposais tout à l'heure d'installer ibex via homebrew, même si ça fait quelque temps que je n'ai pas testé. L'installation sera au moins aussi simple qu'avec macports (brew install ibex), mais il faut installer homebrew au préalable : https://brew.sh/ (pour le désinstaller, il suffit de supprimer le dossier où il s'est installé, normalement /opt/homebrew). Si cela ne marche pas, tu auras perdu 2 minutes seulement... Par contre, je ne suis pas sûr que tu puisses demander à homebrew d'installer ibex avec gcc.