I recently downloaded the graclus software. While trying to install it I had to be complete the makefile.in with some options.I figured out other options but I couldn't find what do we write for the LDOPTIONS.
Can anybody help me out in figuring what do I fill in the options used by the compiler?
Help will be truly appreciated.
//Here is the makefile.in
# Which compiler to use
CC = g++
# What optimization level to use
OPTFLAGS = -O2 -fPIC
# What options to be used by the compiler
COPTIONS = -DNUMBITS=32
# What options to be used by the loader
LDOPTIONS =
# What archiving to use
AR = ar rv
# What to use for indexing the archive
RANLIB = ranlib
ARCH = P4SSE2
LAPACK = -llapack_$(ARCH)
ARPACK = -lcarpack_$(ARCH)
ATLAS = -latlas_$(ARCH)
CBLAS = -lcblaswr -lcblas -lblas -lmyf2c
GSL = -lgslcblas -lgsl
SPARSE = -lsparse
UTIL = -lmyutil
Since the Makefile you provided is just an excerpt and you've not mentioned what package or library you're compiling it with, I'm just making a wild-guess here.
LDOPTIONS could serve a similar puprose as the commonly used variable LDFLAGS which provides a way to specify extra flags to the linker. It depends on the linker you use. If you're using gcc, then you can run man ld to see the list of linker options.
Related
Hi in my project I configure the gcc to be used by the option
meson build --cross-file mygcc.txt
in the file mygcc.txt I set the gcc commands needed:
[binaries]
c = '/usr/bin/gcc'
cc = '/usr/bin/gcc'
cpp = '/usr/bin/g++'
ar = '/usr/bin/gcc-ar'
strip = '/usr/bin/strip'
ld = '/usr/bin/ld'
....
I wonder if it is possible to set dynamically the root where the gcc is installed.
for example if I use gcc-toolset I can switch the default gcc installed under
/user/bin
to
/opt/rh/gcc-toolset-9/root/usr/bin
and in order to use the new gcc I need to change the path in mygcc.txt , remove the build dir and reconfigure meson.
but is it possible to configure meson in order to pick the gcc set in the bash used?
devel#lnx+ which gcc
/opt/rh/gcc-toolset-9/root/usr/bin/gcc
In order to solve the problem I have modified the mygcc.txt file in
[binaries]
c = 'gcc'
cc = 'gcc'
cpp = 'g++'
ar = 'gcc-ar'
strip = 'strip'
ld = 'ld'
pkgconfig = 'pkg-config'
.......
then in the .bashrc I have added
#source gcc
source /opt/rh/gcc-toolset-9/enable
I am trying to compile my code using mpi on my macbook but I get the following error:
"ld: library not found for -lblacsF77init". I don't understand where I can find this library and how to create a correct path.
This is the makefile: # serial Fortran compiler program
F90 = gfortran -I/usr/local/include
# parallel Fortran compiler program
MPIF90 = /usr/local/bin/mpif90.
# Compiler flags
F90FLAGS =
CFLAGS = -x f95-cpp-input.
# LDFLAGS are the linker flags
LDFLAGS = -L/usr/local/lib
F77LIBS =.
MATLIB = -framework Accelerate
hsl = /usr/local/opt/scalapack/
hb = /usr/local/opt/openblas/
hompi = /usr/local/lib/openmpi/
MPIMATLIB = -L$(hb) -L$(hsl) -lscalapack -L$(hsl) -lblacsF77init -
lblacs -lblacsF77init -L$(hompi) -Wl,-framework,vecLib
Thank you very much for any help you may provide.
If you are on a macbook running OSX, you don't need to build scalapack:
brew install scalapack gcc
A line in the README says :
manually specify the OpenCV flags in the Makefile as following:
INCS = -I/usr/local/include/opencv
LIBS = -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml
I'm using Windows(OpenCV version 3.3.1). Can you guess what should I use instead to make it work on Windows?
Here's a link to the Makefile https://github.com/npinto/fddb-evaluation/blob/master/Makefile
In an attempt to build a gcc 4.x.x cross compiler for arm, I'm stuck at a missing crti.o file in the $BUILD_DIR/gcc subdirectory.
An strace on the top level Makefile shows that the compiled xgcc is calling the cross-linker ld with "crti.o" as an argument. I'm assuming that if the cross linking ld is being called, the native /usr/lib/crti.o is not what is needed.
I can see that in the gcc source tree there is a number of potential sources for a crti object (including $SRC_DIR/gcc/config/arm/crti.asm).
How can I configure the gcc build to insure this file is built (or omitted from the ld command)?
Here is my configure line:
/x-tools/build/gcc-4.5.0$ ../../src/gcc-4.5.0/configure --target=arm-linux --prefix=/opt/arm-tools --disable-threads --enable-languages=c
The real answer is that it should compile crti.o if one was to build an arm-elf target. In building an arm-linux target, the gcc people reasonably assume that glibc has been compiled previously and it will provide the crti.o startup. Perfectly reasonable, if you're upgrading.
Building a new root file system is another story, a paradoxical one at that (which comes first: glibc or gcc?). An approach (endorsed, but I've not yet succeeded with) is to build a stand-alone gcc (arm-elf\static, say) then glibc, then gcc again.
It seems as though some have addressed the missing crti.o in an arm-linux target by modfiying gcc\config\arm\t-linux. Rather than relying on an unexisting glibc, the kludge is to use the arm-elf provided version of the crti.o. An example can be found here.
--- gcc-3.4.4/gcc/config/arm/t-linux 2003-09-20 17:09:07.000000000 -0400
+++ gcc-3.4.4.works/gcc/config/arm/t-linux 2005-05-25 20:44:07.000000000 -0400
## -18,3 +18,24 ##
# LIBGCC = stmp-multilib
# INSTALL_LIBGCC = install-multilib
+
+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
+
+# If EXTRA_MULTILIB_PARTS is not defined above then define EXTRA_PARTS here
+# EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
+
+# Assemble startup files.
+$(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/arm/crti.asm
+
+$(T)crtn.o: $(srcdir)/config/arm/crtn.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/arm/crtn.asm
+
+# Disable libc link
+
+SHLIB_LC =
I'm trying to generate a python wrapper for a C++ library that I am putting together. I have just come across SWIG and am trying to use this in conjunction with distutils. I'm modifying someone elses code, so odd errors were to be expected but this one is just confusing.
I've managed to generate a c++ wrapper file with SWIG and am now attempting to run a modified version of setup.py in order to install the wrapper (which itself may or may not work, but I'll cross that bridge when it comes to it.) When doing this compiler errors pop up about inability to include header files. Specifically - string, ostream, sstream, map and vector. All of which are standard libraries, included as "include ".
The code itself compiles, but in trying to create a wrapper this way it does not.
I'm not entirely sure what information is relevant to this but this is how the extension is made:
## Extension definition
import os
wrapsrc = './project_rewrite_wrap.c'
incdir_src = os.path.abspath('../include/project')
incdir_build = os.path.abspath('../include/project')
libdir = os.path.abspath('../lib')
ext = Extension('_project_rewrite',
[wrapsrc],
include_dirs=[incdir_src, incdir_build],
library_dirs=[libdir, os.path.join(libdir,'.libs')],
libraries=['ProjectMain'])
The gcc command that is run is:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/ben/Project/rewrite/include/Project -I/home/ben/Project/rewrite/include/Project -I/usr/include/python2.6 -c ./project_rewrite_wrap.c -o build/temp.linux-i686-2.6/./project_rewrite_wrap.o
Which results in errors such as:
./project_rewrite_wrap.c:2696:18: error: string: No such file or directory
Any thoughts would be greatly appreciated, thanks.
You are compiling C code - the headers you mention are part of C++, not C. To compile as C++ code, use the g++ driver instead of gcc, and give the source files a .cpp extension instead of .c.