esternin / eXtrema

https://www.physics.brocku.ca/Labs/extrema/
GNU General Public License v2.0
6 stars 1 forks source link

What is the standard way to build this tool under Windows+Code::Blocks? #58

Open asmwarrior opened 1 year ago

asmwarrior commented 1 year ago

I see this project use auto configure tool, so the only way to build it is under a bash like shell? Such as the mingw64 shell under msys2?

Any suggestions? Thanks.

asmwarrior commented 1 year ago

OK, I have succesfully build the extrema.exe under Code::Blocks and msys2(mingw64).

I have added a Code::Blocks cbp file to build this project.

See here: https://github.com/asmwarrior/eXtrema

BTW: It looks some source files are not need to build the exe, my guess is that they are not fully implemented. Here are the source files I don't used to build the exe, I initially add all the cpp/h files, but I got a lot of build errors, and finally I just compared with the file makefile.am, and I see those files are not needed. I first thought I need PLplot library, but finally I found I don't need it.

src/Commands/CMD_surface.cpp
src/Graphics/GRA_surfacePlot.cpp
src/wxForms/ColorSelector.cpp
src/wxForms/wxPLplotstream.cpp
esternin commented 1 year ago

I am glad you have figured it out! I do not use Windows systems at all, but I do have a Win7 in a VirtualBox. All the Windows binaries (I have a 4.7.1 rc on www.physics.brocku.ca/Labs) are built using mingw cross-compiler from a Linux host.

Yes, there are some unused files in the tree. Some are remnants of previously implemented and no longer used commands, some are "to be implemented", some I am not sure about. Thanks for identifying them all! Maybe I should move them aside for now...

Do you want to add your cbp file to this site? @vadz did the toolchain, I would want him to review it, if possible, and then we could pull it in.

asmwarrior commented 1 year ago

Hi, thanks for the response, the cbp file is very simple.

It just add all the source files(.h and .cpp) to the project, and add the compiler option(include search path for wx header) and linker option(link to wx libraries) to the project.

The only issue I see is that I don't have any intermedia libraries to build. I mean I just build all the cpp files, and later link the object files to an exe file.

EDIT:

The msys2 ships the wx library 3.2.1, so my built exe is linked against this wx library.

vadz commented 1 year ago

Sorry, I don't know much about C::B so I have no comments on the .cbp file. If it works, it must be good enough, the question here is, as usual, about maintaining it, i.e. how not to forget to add new files to it when they're added to Makefile.in etc.

esternin commented 1 year ago

@asmwarrior: I agree with @vadz, and your "extra files" story points to it as well: there should only be one place with a list of files that need to be made, whether by make/automake or by code:blocks (I am not familiar with it, either).

How about a script, or a small .c utility that parses Makefile.in and spits out your .cbp file? I would be happy to add such a thing to the package, for those who actually want to compile natively under Windows, instead of mingw cross-compiling like it's set up at the moment.

Edit: And, actually, since one can import makefiles into codeblocks, I am not even sure why .cbp is even needed. But if you find/build a utility that does it, that would be grand!