Closed tissatussa closed 1 year ago
Hi, thank you for noticing this issue. It was an issue that didn't produce any errors on my mac so I didn't catch it earlier, but it should be fixed now.
indeed it is fixed : now i succeed compiling a binary v4.3.9 ! but wonder .. in the README you state :
Altair can also be built from the source code with cmake, using the CMakeLists.txt, and make, using the makefile.
at first, as i wrote, i re-created a makefile by cmake .
.. then make
gives me a binary of 7.3 Mb, which is big compared to the 303.8 Kb binary i get when using your supplied makefile !? Both run fine and show v4.3.9
To clarify, your own created makefile is generating a larger exe? If so, I would be unsure as to why this is happening. On my mac, the cmakelists and makefile generate an exe that is about the same size. If you are statically linking libraries, it will link these libraries into the executable at compile time which will produce a much larger exe size.
If you are statically linking libraries..
how could i ? i just use the makefile generated by cmake, without editing anything (except disabling the supplied makefile by temporarily renaming it).
To clarify, your own created makefile is generating a larger exe..
yes
If you are statically linking libraries..
how could i ? i just use the makefile generated by cmake, without editing anything (except disabling the supplied makefile by temporarily renaming it).
If you are just directly using the cmakelists without any edit, then it may be building the exe in debug mode. To check this you can just run Altair by typing bench
and comparing the nps to the exe created with the provided makefile. If it is being built in debug mode the exe may be bigger, and definitely slower. You can type set(CMAKE_BUILD_TYPE Release)
at around line 7 of the CMakelists in order to build a release mode executable.
thanks for this detailed info !
i'm not too familiar with C++, i will try your edit .. Btw. i never did edit any CMakelists
file, i always thought the cmake
process would create a custom makefile
for the concerning computer and its hardware .. does some argument exists for the cmake
command to achieve what you suggest around line 7 ? Often a make
command excepts such arguments also ..
doing set(CMAKE_BUILD_TYPE Release)
gave no smaller binary, it's still 7.3 Mb .. the if statement "around line 7" is like this (in fact at lines 9 10 and 11) :
# Default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
when removing the if-else clause, only leaving the set(..) command, nothing changes : "Release" is built !? I did not yet try bench
..
Ok. I am not too sure then. Thanks for pointing this out, if I figure anything out I will let you know, but for now the makefile I have created should work adequately.
after a
git clone
of your newest source (upto PR 118) i get an error during compilation, see my terminal output below. btw. i (re)created the makefile by the commandcmake .
and then i didmake
. [ i'm on Xubuntu 22.04 ]