cannot compile cpp code that uses GiNaC on Mac OS 10.15.7 (Catalina)
Hello, I'm trying to compile cpp code that depends on GiNaC. The code is in this file: https://arxiv.org/src/1912.09099v1/anc/GPLs.cpp and I tried compiling it with the following command: g++ -std=c++11 GPLs.cpp -o GPLs.out -w -lcln -lginac I tried several alternatives for the -std option, but c++11 is the one producing the smallest amount of errors. The output I get is in the attached GPLs.log file. My OS is Mac OS Catalina (10.15.7). My compiler options are as follows: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.0 (clang-1200.0.32.21) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin I get the very same errors if I use the GNU compiler, but I understand that, under Mac, g++ = gcc = clang. I installed GiNaC through homebrew, and this is the version I have: ginac: stable 1.8.0 (bottled) Not a Computer algebra system https://www.ginac.de/ /usr/local/Cellar/ginac/1.8.0 (66 files, 8.9MB) * Poured from bottle on 2020-12-19 at 16:28:49 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/ginac.rb License: GPL-2.0 ==> Dependencies Build: pkg-config ✔ Required: cln ✔, python@3.9 ✔, readline ✔ I had also tried to install GiNaC as well as CLN from git, but I get similar errors. I inspected GiNaC's lst header (the constructor producing the errors) but I cannot find anything wrong with it. Any help is greatly appreciated. Beste Grüße, Diego
Hello, Diego, The problem is with the new lst container initialisation. I am attaching a patch to this code. With this patch I am able to compile the code with your command g++ -std=c++11 GPLs.cpp -o GPLs.out -w -lcln -lginac on my Debian box. Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks
On Sun, 20 Dec 2020 14:12:11 +0000, Di Gi <dgo.gaz@gmail.com> said:
Di> Hello, Di> I'm trying to compile cpp code that depends on GiNaC. The code Di> is in this file: Di> https://arxiv.org/src/1912.09099v1/anc/GPLs.cpp Di> and I tried compiling it with the following command: Di> g++ -std=c++11 GPLs.cpp -o GPLs.out -w -lcln -lginac Di> I tried several alternatives for the -std option, but c++11 is Di> the one producing the smallest amount of errors. Di> The output I get is in the attached GPLs.log file. Di> My OS is Mac OS Catalina (10.15.7). My compiler options are as Di> follows: Di> Configured with: Di> --prefix=/Applications/Xcode.app/Contents/Developer/usr Di> --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Di> Apple clang version 12.0.0 (clang-1200.0.32.21) Target: Di> x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: Di> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Di> I get the very same errors if I use the GNU compiler, but I Di> understand that, under Mac, g++ = gcc = clang. Di> I installed GiNaC through homebrew, and this is the version I Di> have: Di> ginac: stable 1.8.0 (bottled) Not a Computer algebra system Di> https://www.ginac.de/ /usr/local/Cellar/ginac/1.8.0 (66 files, Di> 8.9MB) * Poured from bottle on 2020-12-19 at 16:28:49 From: Di> https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/ginac.rb Di> License: GPL-2.0 ==> Dependencies Build: pkg-config ✔ Required: Di> cln ✔, python@3.9 ✔, readline ✔ Di> I had also tried to install GiNaC as well as CLN from git, but I Di> get similar errors. Di> I inspected GiNaC's lst header (the constructor producing the Di> errors) but I cannot find anything wrong with it. Di> Any help is greatly appreciated. Di> Beste Grüße, Diego
Hello Vladimir, thank you for the prompt answer. I implemented the patch, but now I get a different error, this time from the linker. The output is attached. Best, Diego
On 20 Dec 2020, at 15:25, Vladimir V. Kisil <V.Kisil@leeds.ac.uk> wrote:
Hello, Diego,
The problem is with the new lst container initialisation. I am attaching a patch to this code. With this patch I am able to compile the code with your command
g++ -std=c++11 GPLs.cpp -o GPLs.out -w -lcln -lginac
on my Debian box.
Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks
On Sun, 20 Dec 2020 14:12:11 +0000, Di Gi <dgo.gaz@gmail.com> said:
Di> Hello,
Di> I'm trying to compile cpp code that depends on GiNaC. The code Di> is in this file:
Di> https://arxiv.org/src/1912.09099v1/anc/GPLs.cpp
Di> and I tried compiling it with the following command:
Di> g++ -std=c++11 GPLs.cpp -o GPLs.out -w -lcln -lginac
Di> I tried several alternatives for the -std option, but c++11 is Di> the one producing the smallest amount of errors.
Di> The output I get is in the attached GPLs.log file.
Di> My OS is Mac OS Catalina (10.15.7). My compiler options are as Di> follows:
Di> Configured with: Di> --prefix=/Applications/Xcode.app/Contents/Developer/usr Di> --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Di> Apple clang version 12.0.0 (clang-1200.0.32.21) Target: Di> x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: Di> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Di> I get the very same errors if I use the GNU compiler, but I Di> understand that, under Mac, g++ = gcc = clang.
Di> I installed GiNaC through homebrew, and this is the version I Di> have:
Di> ginac: stable 1.8.0 (bottled) Not a Computer algebra system Di> https://www.ginac.de/ /usr/local/Cellar/ginac/1.8.0 (66 files, Di> 8.9MB) * Poured from bottle on 2020-12-19 at 16:28:49 From: Di> https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/ginac.rb Di> License: GPL-2.0 ==> Dependencies Build: pkg-config ✔ Required: Di> cln ✔, python@3.9 ✔, readline ✔
Di> I had also tried to install GiNaC as well as CLN from git, but I Di> get similar errors.
Di> I inspected GiNaC's lst header (the constructor producing the Di> errors) but I cannot find anything wrong with it.
Di> Any help is greatly appreciated.
Di> Beste Grüße, Diego
<patch.diff>
On Sun, 20 Dec 2020 15:33:59 +0000, Di Gi <dgo.gaz@gmail.com> said:
Di> Hello Vladimir, Di> thank you for the prompt answer. I implemented the patch, but Di> now I get a different error, this time from the linker. The Di> output is attached. Sorry, as a Linux user I will not be able to assist with MacOS-specific issues. However, it looks like you need explicitly specify libstd to the linker. -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks Di> Best, Diego >> On 20 Dec 2020, at 15:25, Vladimir V. Kisil <V.Kisil@leeds.ac.uk> >> wrote: >> >> Hello, Diego, >> >> The problem is with the new lst container initialisation. I am >> attaching a patch to this code. With this patch I am able to >> compile the code with your command >> >> g++ -std=c++11 GPLs.cpp -o GPLs.out -w -lcln -lginac >> >> on my Debian box. >> >> Best wishes, Vladimir >> -- >> Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: >> Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: >> Geometry of cycles http://moebinv.sourceforge.net/ Jupyter >> notebooks: https://github.com/vvkisil/MoebInv-notebooks >>>>>>> On Sun, 20 Dec 2020 14:12:11 +0000, Di Gi >>>>>>> <dgo.gaz@gmail.com> said: >> Di> Hello, >> Di> I'm trying to compile cpp code that depends on GiNaC. The code Di> is in this file: >> Di> https://arxiv.org/src/1912.09099v1/anc/GPLs.cpp >> Di> and I tried compiling it with the following command: >> Di> g++ -std=c++11 GPLs.cpp -o GPLs.out -w -lcln -lginac >> Di> I tried several alternatives for the -std option, but c++11 is Di> the one producing the smallest amount of errors. >> Di> The output I get is in the attached GPLs.log file. >> Di> My OS is Mac OS Catalina (10.15.7). My compiler options are as Di> follows: >> Di> Configured with: Di> --prefix=/Applications/Xcode.app/Contents/Developer/usr Di> --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Di> Apple clang version 12.0.0 (clang-1200.0.32.21) Target: Di> x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: Di> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin >> Di> I get the very same errors if I use the GNU compiler, but I Di> understand that, under Mac, g++ = gcc = clang. >> Di> I installed GiNaC through homebrew, and this is the version I Di> have: >> Di> ginac: stable 1.8.0 (bottled) Not a Computer algebra system Di> https://www.ginac.de/ /usr/local/Cellar/ginac/1.8.0 (66 files, Di> 8.9MB) * Poured from bottle on 2020-12-19 at 16:28:49 From: Di> https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/ginac.rb Di> License: GPL-2.0 ==> Dependencies Build: pkg-config ✔ Required: Di> cln ✔, python@3.9 ✔, readline ✔ >> Di> I had also tried to install GiNaC as well as CLN from git, but I Di> get similar errors. >> Di> I inspected GiNaC's lst header (the constructor producing the Di> errors) but I cannot find anything wrong with it. >> Di> Any help is greatly appreciated. >> Di> Beste Grüße, Diego
participants (2)
-
Di Gi
-
Vladimir V. Kisil