If you build libblas.a in the directory where you run your make then: LDFLAGS = -L. So change your LDFLAGS to: LDFLAGS = -L/path/to/your/liblas/build -lblas I dont think theres any other way to do it. That is convert the prerequisite to a sub-make invocation with -s. then you could do something like this: run: (MAKE) -s binary. The linker what directory to search for libblas.a using the L linker option. I dont know if I really understand the question. However, if you want to build itĪnd link it statically then (having done so), your makefile must tell Your linux distribution will almost certainly provide it as a shared library You are doing that, as a) your makefile does not build it and b) (Take care to correct the typo $(PROGRAMS) to $(PROGRAM) in theĪs for linking libblas as a static library it is unclear where or why Would not even get as far as linkage errors. That one defines no rule for making $(PROGRAM) at all, so it I doubt that your makefile looks like the one you have posted as I don't think it is being called / used by the makefile.Īs others have said, the link errors you are seeing not related to libblas I noticed that removing libblas.a from the working directory makes no difference. f08 / makefile on the off chance that this is a relevant point I have placed libblas.a in the same directory as the. Ld: symbol(s) not found for architecture x86_64Ĭollect2: error: ld returned 1 exit statusĬould someone highlight how to correctly link static libraries? Undefined symbols for architecture x86_64: Gfortran -g -O2 -o Consistency_Check Consistency_Check.o -lblas The makefile that I produced so far (which may have errors as I'm new to this) is: compiler FC /usr/bin/gfortran-4.5 compile flags FCFLAGS -g -c -fdefault-real-8. I need to build an executable from it, but I'm having some problems. I am clearly linking the libraries incorrectly as I get the error: gfortran -g -O2 -c Consistency_Check.f08 I have a FORTRAN source code consisting of many different. # and not the additional prerequisites such as module or include files # used in order to list only the first prerequisite (the source file) # General rules for building prog.o from prog.f90 or prog.F90 $< is Re: PATCH - Fix bogus dependency in Makefile.in 9:20 PATCH - Fix bogus dependency in Makefile. # used in order to list additional object files on which the # General rule for building prog from prog.o $^ (GNU extension) is # List of subroutines to be built within the package # List of executables to be built within the package # flags for debugging or for maximum performance, comment as necessary My make file looks like the following and has just basically been copied from online: # = So far I understand that I need to make the BLAS static library using the following: gfortran -O2 -c *.fĪpparently after this you can link programs with BLAS using -lblas on command-line. I have never made an executable that is dependant on static libraries before though. I am trying to create a program which will be pretty heavily dependant on BLAS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |