raphael-group / wext

A Weighted Exact Test for Mutually Exclusive Mutations in Cancer
http://compbio.cs.brown.edu/projects/wext
Other
21 stars 5 forks source link

Fortran compilation error during setup #32

Open olea-digitalis opened 5 years ago

olea-digitalis commented 5 years ago

In the final step of setting up the repository (f2py -c src/fortran/bipartite_edge_swap_module.f95 -m bipartite_edge_swap_module) I am encountering an error. It says the following:

/lib/../lib64/crt1.o: In function '_start':
(.text+0x20): undefined reference to 'main' 

Here is an image for more context image

matthewreyna commented 5 years ago

Could you check which version of NumPy you are using or try updating to the latest version of NumPy? The f2py command is part of the NumPy package, and some versions of NumPy have introduced bugs in f2py. You can run python -c 'import numpy; print numpy.__version__' to check.

olea-digitalis commented 5 years ago

My NumPy version is 1.15.4

I can see about updating to the latest version of NumPy if you think that is the source of the bug, but I am on a shared file system so I would have to check with my advisor before moving forward with that.

matthewreyna commented 5 years ago

NumPy 1.15.4 works for me, so I do not think that an update is necessary. Could you the first example on this page, i.e., save fib1.f and run f2py -c fib1.f -m fib1? If the error persists, then there may be some kind of issue with NumPy and the Fortran compiler/GCC. https://docs.scipy.org/doc/numpy-1.15.4/f2py/getting-started.html

olea-digitalis commented 5 years ago

When I execute that code I get the same error. Do you have any speculation about how I might go about resolving the issue?

Oh and there are also some warnings with it about "Using deprecated NumPy API". These also occurred when running the original code. Below is the full output that happens when I run f2py -c fib1.f -m fib1

screenshot from 2019-01-17 15-57-29

screenshot from 2019-01-17 15-57-55

matthewreyna commented 5 years ago

Since NumPy's example code also returns an error, it looks like NumPy and/or GCC may not be correctly installed on your system. Unfortunately, this is difficult to troubleshoot without knowing more about your system.

The "deprecated NumPy API" warnings are normal and not a problem.

alvaro-andrades commented 5 years ago

I had the exact same error and, in my case, it was due to my LDFLAGS.

If your LDFLAGS environment variable is not empty, try executing: unset LDFLAGS before running wext. That fixed it for me.