molovol / MoloVol

MoloVol is a free, cross-plattform, scientific software for volume and surface computations of single molecules and crystallographic unit cells.
https://molovol.com
MIT License
22 stars 4 forks source link

Default elements file not working #117

Closed BSVogler closed 7 months ago

BSVogler commented 2 years ago

I compiled the application and ran it. The relative import set by default in the elements file does not work.

I think the default file should be included in the binary and loaded if nothing is specified by the user.

jmaglic commented 2 years ago

Can you provide more information on how you compiled it?

I have a suspicion what your issue may be. I wrote the makefile according to my personal development setup, so it has some idiosyncrasies that may seem strange to someone who's not intimately familiar with it.

When you run make, you are building the development build. The executable is supposed to quickly compilable and testable. It uses relative paths and works directly from the build directory, independently from the platform.

Then there's the "release" target in the makefile. The relevant difference between this build and the development build is that the release build needs to change the path to the directory that contains the resource files (i.e., elements.txt and space_group.txt). These paths are platform dependant. On Ubuntu and Debian installation files are placed in /usr/share/molovol whereas on macOS the resource files are stored within the Application Bundle (see getResourcesDir() in misc.cpp). However, running make release neither places the resource files in /usr/share/molovol nor creates the Application Bundle.

Because of this, the release executable is unusable by itself. It's just an ingredient to the (platform-specific) installation package. These are currently created by running make deb for Ubuntu/Debian or make appbundle for macOS.

I plan on moving from the makefile to Cmake. As of now, Cmake can be used to build the debug and release targets as explained above but does not produce installation packages.

If you're building on another OS than the ones currently supported, it would likely be necessary to write some platform specific code so that the final executable searches the appropriate paths.

BSVogler commented 2 years ago

I think I build the debug version. I built it in docker using the makefile.

jmaglic commented 7 months ago

Since we have completely transitioned to CMake, I will consider this issue resolved.