hzi-bifo / mdasim

MDAsim 2: a Multiple Displacement Amplification Simulator (continued development from: https://sourceforge.net/projects/mdasim/)
GNU General Public License v3.0
1 stars 1 forks source link

`mkdir` for `obj` `lib` and `bin` in the Makefile #7

Closed dlaehnemann closed 6 years ago

dlaehnemann commented 6 years ago

To avoid having to have these empty pre-created folders in the repo and to avoid the current workaround in the bioconda recipe, I would switch to creating them in the Makefile along the structure of this template:

https://stackoverflow.com/a/1951024

VSack commented 6 years ago

I had a couple of issues concerning the output when there's actually nothing to be done for the Makefile, but I found a workaround: 0493a07 So now it will always attempt to create those folders, but there will be no output. Using the |-Operator as suggested in this Stackoverflow topic led to odd permission denied errors, however it would be the cleaner solution.

VSack commented 6 years ago

Closed by 08eb6314a8c61ef42a471c1030bc49d132dd0783

dlaehnemann commented 6 years ago

Hmm, just wanted to check some things with our latest mdasim version and starting with the above cited commit, it doesn't compile on my machine. The error message I get when running make prefix=. is:

mpic++ -m64 -openmp -pthread -O3 -DMAXK= -DFIXEDPOINTPROB=1 -pthread -lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lm -ldl -Wl,--export-dynamic obj/mdasim.o -lmdasim -o bin/mdasim
/usr/bin/ld: cannot find -lmdasim
collect2: error: ld returned 1 exit status
Makefile:34: recipe for target 'bin/mdasim' failed
make: *** [bin/mdasim] Error 1

So I am assuming, we have killed the making of the lib/libmdasim.a and you might have just had a version of that still kicking around in your directory when we were cleaning up the build process. So I am reopening this issue, as this needs fixing...

VSack commented 6 years ago

When I clone the current state of this repo in a new folder and run make clean and make prefix=., it builds quite fine:

mkdir -p ./obj
mkdir -p ./bin
mpic++ -m64 -openmp -pthread -O3 -DMAXK= -DFIXEDPOINTPROB=1 -pthread -lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lm -ldl -Wl,--export-dynamic -I.//include -c src/mdasim.C -o obj/mdasim.o 
mpic++ -m64 -openmp -pthread -O3 -DMAXK= -DFIXEDPOINTPROB=1 -pthread -lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lm -ldl -Wl,--export-dynamic obj/mdasim.o -lmdasim -o bin/mdasim
rm obj/mdasim.o

Did you try this in an empty folder or did you just git pull? In that case, it might be that you have some files still kicking around that mess this up?

VSack commented 6 years ago

Correction, ignore everything I said before 😂 Apparently, at least that is my guess, earlier runs of make have installed some mdasim-library that handles the getopt-functions. The error you get is caused by a dependency on this library. When I deleted the usage of the library from the Makefile, it couldn't find getOpt(...) anymore, so I included getOpt.C in mdasim.C (tbh I'd prefer to include the .h-file but this seems to be the coding convention in this project, maybe we can fix this later). Anyway, after pulling f2470dfdaa752f0ed63cbf1562e8fcbf6a12af99 the project should build on your machine as well.

Please let me know if it works now!

dlaehnemann commented 6 years ago

Jep, I can confirm that the newest version now compiles properly. So I'll close this issue again.

Thanks for double-checking this!