Support #1591
Compilation of Normaliz
Description
With my new computer I cannot compile libnormaliz succesfully.
MacOS 10.15 Catalina
with personal installation of GMP-6.2.0
Investigate and write proper instructions in http://cocoa.dima.unige.it/cocoalib/doc/html/ExternalLibs-Normaliz.html
Related issues
History
#1 Updated by John Abbott almost 3 years ago
I suggest as a first step we try to contact Bruns to whether the Normaliz people can fix this quickly and easily.
If the Normaliz people are reluctant then we must find an alternative solution (modifying someone-else's build system... urgh).
#2 Updated by John Abbott almost 3 years ago
Following on from an email discussion between Winfried Bruns and Anna...
Anna is simulating a set-up where a user, without "sudo" capability, wishes to compile CoCoALib/CoCoA-5 from source.
Currently the simulation involves using a compiled-but-not-installed version of GMP; this means that the relative path from libgmp.a
to the header file is "unusual".
Now I wonder whether it may not be better in the simulation to install GMP somewhere below the user's home directory, and then supply as the path for GMP the location of this installed version. Such an approach should then also work well with other libraries which use GMP (so long as the right path can be specified).
A further point is that, in principle, installation of GMP might do more than simply copy files from one place to another; so it could, in principle, be unsafe/incorrect to use files from inside the compilation tree.
What do you think, Anna?
#3 Updated by Anna Maria Bigatti almost 3 years ago
It seems that I managed to compile libnormaliz.a with my gmp.
(info in our doc file, when I see it working)
But now we have another problem: both me and John get this error massage when we compile
ExternalLibs-Normaliz.C:276:43: error: no member named 'getTriangulationGenerators' in 'libnormaliz::Cone<__gmp_expr<mpz_t, mpz_t> >' ConvertFromNormaliz(v, c->myConeMPZ.getTriangulationGenerators()); ~~~~~~~~~~~~ ^
Investigate.
#4 Updated by John Abbott almost 3 years ago
- Related to Support #1494: Normaliz 3.8.9 added
#5 Updated by Anna Maria Bigatti almost 3 years ago
The data types in Normaliz have changed. Now we need to understand what we should pick.
I tried
//ConvertFromNormaliz(v, c->myConeMPZ.getTriangulationGenerators()); /// v 3.8.9 ConvertFromNormaliz(v, (c->myConeMPZ.getTriangulation()).first); /// v 3.8.10
but does not compile, nor with
second
.
ConvertFromNormaliz
is
void ConvertFromNormaliz(std::vector<std::vector<BigInt> >& v, const std::vector<std::vector<mpz_class> >& l);
In conclusion: investigate if first or second, and also why neither compile.
#6 Updated by Anna Maria Bigatti almost 3 years ago
- Related to Support #1592: Normaliz 3.8.10 added
#7 Updated by John Abbott over 2 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
What is the status of this issue?
Have it been resolved? Is there documentation? It would be good to close it, if possible.
#8 Updated by John Abbott about 2 years ago
I have just checked, and observe that there is now Normaliz 3.9.1.
I shall try compiling.
UPDATE Compiled without any apparent problem (took about 3 mins). Also make check
was OK. Not yet tried compiling CoCoALib...
#9 Updated by John Abbott about 2 years ago
- Related to Design #1655: Remove ability to compile CoCoALib against UNINSTALLED gmp? added
#10 Updated by John Abbott about 2 years ago
- % Done changed from 10 to 30
I compiled Normaliz without any problems: here are my notes:
cd normaliz-3.9.1 export GMP_INSTALLDIR=/usr/local ./configure --disable-shared --disable-openmp make # took about 2.8 mins' CPU --> result is in source/libnormaliz.la or source/.libs/libnormaliz.a make check # took about 1 minute
#11 Updated by John Abbott about 2 years ago
- Related to Support #618: Instructions for compiling libnormaliz added
#12 Updated by John Abbott about 2 years ago
- Status changed from In Progress to Feedback
- % Done changed from 30 to 90
#13 Updated by John Abbott about 2 years ago
I compiled normaliz on my old MacBook without any problems (following the instructions above, in comment 10).
#14 Updated by John Abbott about 2 years ago
I have also had success with normaliz-3.9.2
(just released). I did see several compiler warnings (about normaliz code) when compiling with -Wextra
.
I hope Anna can confirm everything is OK, and close this issue tomorrow.
#15 Updated by Anna Maria Bigatti about 2 years ago
John Abbott wrote:
I compiled Normaliz without any problems: here are my notes:
[...]
They didn't work for me (still looking in /usr/local instead of my GP dir). I followed the guidelines from :./configure --help@:
cd normaliz-3.9.2 ./configure --disable-shared --disable-openmp --with-gmp=/Users/bigatti/0.99/GMP make --> I get source/libnormaliz.la, but not source/libnormaliz.a
But with this error:
libtool: link: g++ -std=gnu++14 -Wall -pedantic -Wno-unknown-pragmas -Wno-sign-compare -g -O2 -Wl,-s -o normaliz normaliz.o -Wl,-bind_at_load -L/Users/bigatti/0.99/GMP/lib ./.libs/libnormaliz.a /Users/bigatti/0.99/GMP/lib/libgmpxx.dylib /usr/local/lib/libgmp.dylib /Users/bigatti/0.99/GMP/lib/libgmp.dylib clang: error: no such file or directory: '/usr/local/lib/libgmp.dylib' make[1]: *** [normaliz] Error 1 make: *** [all-recursive] Error 1
why /usr/local/lib/libgmp.dylib?
and why dylib, with --disabled-shared?
#16 Updated by John Abbott about 2 years ago
Did you try following comment 10?
#17 Updated by Anna Maria Bigatti about 2 years ago
John Abbott wrote:
Did you try following comment 10?
yes, did not work: $GMP_INSTALLDIR
not used, that's why I had to use "--with-gmp" to specify the path, but somewhere it still looks for /usr/local/lib/libgmp.dylib, and I cannot find how to disable it. Still investigating.
#18 Updated by John Abbott about 2 years ago
Try
https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html
#19 Updated by Anna Maria Bigatti about 2 years ago
This worked for me:
cd normaliz-3.9.2 ./configure --disable-openmp --with-gmp=/Users/bigatti/0.99/GMP make
I get the same error as before, but I have what I need:
source/.libs/libnormaliz.a
!
Compiled with CoCoA, works.
#20 Updated by Anna Maria Bigatti about 2 years ago
- Related to Support #1665: Compilation on Windows: problems for normaliz added
#21 Updated by Anna Maria Bigatti about 2 years ago
- Status changed from Feedback to Closed
- % Done changed from 90 to 100
Mac and Linux now done. I made a new issue for windows/cygwin #1665
#22 Updated by Anna Maria Bigatti about 2 years ago
- Estimated time set to 5.01 h