-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile/run on macOS #3
Comments
Thanks @quinntpratt! I don't know why that is. I don't own a Mac and haven't used it before. What I think this
suggests is that What does |
Hi @milancurcic,
results in,
|
OK, thanks. I don't think the underscore is our problem. I'll do some searching. |
FYI: libdill now has a homebrew formula for macOS: https://formulae.brew.sh/formula/libdill macOS users should not need to build it manually, but have the option to simply issue: brew install libdill |
Hello, I've been following along in your book "Modern Fortran" to learn the basics of the language.
I made it all the way to chapter 11 (great book by the way!) and now I've encountered an issue with the c-binding business...
I was able to install/compile
libdill
with no errors following the commands given in section 11.1.2.However, the initial versions of the files:
mod_dill.f90
, andserver.f90
given in listings 11.2 and 11.3 in the textbook don't work for me.I also tried jumping to the end of the chapter, cloning this repo, and following the instructions in the readme file that didn't work either (with a similar error).
I am able to compile both module/program with no issue,
>> gfortran -c mod_dill.f90 server.f90
which produces the binary files... but when it comes to linking them with,
>> gfortran mod_dill.o server.o -o server
I'm hit with:
which suggests a leading underscore is being added to the libdill function
dill_ipaddr_local
at compile time? (I don't know C really at all), and thusbind(c,name="dill_ipaddr_local")
can't find its binding?In an effort to track this down further I wrote a simple
hello_world.c
program with a function to print "Hello world" and that encountered the same issue with the underscores unless I compile and link the c program withgfortran
as well (instead ofgcc
)... but I'm not sure how I can apply this information to the compilation/binding oflibdill
.Any help with this would be amazing - and I'm sure others working on macOS would benefit too.
Thank you.
Other info:
>> gfortran --version
gives,My machine is a Macbook Pro (with intel CPU) running macOS 11.7.2 (big sur)
The text was updated successfully, but these errors were encountered: