Sphinkie / StarGen-II

Realistic solar systems generator
https://sphinkie.github.io/StarGen-II/
MIT License
22 stars 0 forks source link

makefile? #1

Closed necrogami closed 2 years ago

necrogami commented 2 years ago

Would it be possible to have a makefile for this? I'm having a really rough time trying to compile this on osx

necrogami commented 2 years ago

So i figured out that i needed qmake and then to run make.

Any idea what i'm missing to be able to compile this?

StarGen-II on  master [?] 
➜ qmake
Project WARNING: Qt has only been tested with version 10.15 of the platform SDK, you're using 11.3.
Project WARNING: This is an unsupported configuration. You may experience build issues, and by using
Project WARNING: the 11.3 SDK you are opting in to new features that Qt has not been prepared for.
Project WARNING: Please downgrade the SDK you use to build your app to version 10.15, or configure
Project WARNING: with CONFIG+=sdk_no_version_check when running qmake to silence this warning.

StarGen-II on  master [?] 
➜ make
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o main.o sources/main.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_Atmosphere.o sources/lib/SG_Atmosphere.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_File.o sources/lib/SG_File.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_FileWriter.o sources/lib/SG_FileWriter.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_File_TXT.o sources/lib/SG_File_TXT.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_File_XML.o sources/lib/SG_File_XML.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_Gas.o sources/lib/SG_Gas.cpp
sources/lib/SG_Gas.cpp:88:49: warning: unused parameter 'pressure' [-Wunused-parameter]
long double SG_Gas::getMeltingPoint(long double pressure)
                                                ^
1 warning generated.
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_Planet.o sources/lib/SG_Planet.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_SolarSystem.o sources/lib/SG_SolarSystem.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_Star.o sources/lib/SG_Star.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC  -I. -I/usr/local/Cellar/qt@5/5.15.2/mkspecs/macx-clang -o SG_Stardust.o sources/lib/SG_Stardust.cpp
sources/lib/SG_Stardust.cpp:328:30: error: use of undeclared identifier 'sqrt'
                protoplanet->reducedmass = pow1_4(protoplanet->mass / (1 + protoplanet->mass));
                                           ^
sources/lib/SG_Const.h:188:25: note: expanded from macro 'pow1_4'
#define pow1_4(a)  sqrt(sqrt(a))
                        ^
sources/lib/SG_Stardust.cpp:350:29: error: use of undeclared identifier 'sqrt'
                        long double mass_ratio = sqrt(protoplanet->criticalmass / protoplanet->mass);
                                                 ^
sources/lib/SG_Stardust.cpp:392:50: error: use of undeclared identifier 'sqrt'
        long double     temp            = perihelion_dist * sqrt(mSun->mLum);
                                                            ^
sources/lib/SG_Stardust.cpp:393:14: error: use of undeclared identifier 'pow'
        return (B * pow(temp,-0.75));
                    ^
sources/lib/SG_Stardust.cpp:453:35: error: use of undeclared identifier 'sqrt'
                long double PlanetReducedMass = pow1_4(PlanetMass / (1+PlanetMass));
                                                ^
sources/lib/SG_Const.h:188:25: note: expanded from macro 'pow1_4'
#define pow1_4(a)  sqrt(sqrt(a))
                        ^
sources/lib/SG_Stardust.cpp:478:8: error: use of undeclared identifier 'fabs'
                if ((fabs(diff) <= fabs(dist1)) || (fabs(diff) <= fabs(dist2)))
                     ^
sources/lib/SG_Stardust.cpp:478:22: error: use of undeclared identifier 'fabs'
                if ((fabs(diff) <= fabs(dist1)) || (fabs(diff) <= fabs(dist2)))
                                   ^
sources/lib/SG_Stardust.cpp:478:39: error: use of undeclared identifier 'fabs'
                if ((fabs(diff) <= fabs(dist1)) || (fabs(diff) <= fabs(dist2)))
                                                    ^
sources/lib/SG_Stardust.cpp:478:53: error: use of undeclared identifier 'fabs'
                if ((fabs(diff) <= fabs(dist1)) || (fabs(diff) <= fabs(dist2)))
                                                                  ^
sources/lib/SG_Stardust.cpp:484:37: error: use of undeclared identifier 'sqrt'
                        long double new_e = PlanetMass * sqrt(PlanetOrbit) * sqrt(1 - pow2(PlanetEccnt));
                                                         ^
sources/lib/SG_Stardust.cpp:484:57: error: use of undeclared identifier 'sqrt'
                        long double new_e = PlanetMass * sqrt(PlanetOrbit) * sqrt(1 - pow2(PlanetEccnt));
                                                                             ^
sources/lib/SG_Stardust.cpp:485:33: error: use of undeclared identifier 'sqrt'
                        new_e = new_e + (ProtoMass * sqrt(ProtoOrbit) * sqrt(sqrt(1 - pow2(ProtoEccnt))));
                                                     ^
sources/lib/SG_Stardust.cpp:485:57: error: use of undeclared identifier 'sqrt'
                        new_e = new_e + (ProtoMass * sqrt(ProtoOrbit) * sqrt(sqrt(1 - pow2(ProtoEccnt))));
                                                                             ^
sources/lib/SG_Stardust.cpp:486:48: error: use of undeclared identifier 'sqrt'
                        new_e = new_e / ((PlanetMass + ProtoMass) * sqrt(new_a));
                                                                    ^
sources/lib/SG_Stardust.cpp:489:12: error: use of undeclared identifier 'sqrt'
                        new_e = sqrt(new_e);
                                ^
sources/lib/SG_Stardust.cpp:507:31: error: use of undeclared identifier 'sqrt'
                        protoplanet->reducedmass = pow1_4(protoplanet->mass / (1 + protoplanet->mass));
                                                   ^
sources/lib/SG_Const.h:188:25: note: expanded from macro 'pow1_4'
#define pow1_4(a)  sqrt(sqrt(a))
                        ^
sources/lib/SG_Stardust.cpp:574:26: error: use of undeclared identifier 'sqrt'
                proto->reducedmass   = pow1_4(proto->mass / (1.0 + proto->mass));
                                       ^
sources/lib/SG_Const.h:188:25: note: expanded from macro 'pow1_4'
#define pow1_4(a)  sqrt(sqrt(a))
                        ^
sources/lib/SG_Stardust.cpp:583:39: error: use of undeclared identifier 'sqrt'
                        mDustDensity = mDustDensityCoeff * sqrt(mSun->mMass);
                                                           ^
sources/lib/SG_Stardust.cpp:584:32: error: use of undeclared identifier 'pow'
                        mDustDensity*= exp(-ALPHA * pow(proto->orbit,(1.0/N)));
                                                    ^
19 errors generated.
make: *** [SG_Stardust.o] Error 1
Sphinkie commented 2 years ago

Hello, I use Qt Creator to compile Stargen. Qt generates a makefile which is in the /build folder. I have added this folder in the repository, so you can access to the makefiles. Tell me if you need something else.

Best regards David

PS: Concerning the "undeclared identifiers" : pow(), sqrt(), etc : it seems that the math library was not included.