How can i use tcov on Solaris in make file? My make file makes .o files and then the .so files which is copying to the lib's folder. I work with Oracle BRM
CFLAGS_solaris= -g -xcg92 -xprofile=tcov
C++FLAGS_solaris= -g -library=%none -DPIN_NOT_USING_OSTREAM
CPPFLAGS = -I$(INCDIR) -I$(INCDIR_MDS) -DPCMCPP_CONST_SAFE
LDFLAGS_solaris= -G
SL_EXT_solaris= so
and i tried also:
this makes the .so file;
$(LIBBILL): $(OBJECTS) $(C++_OBJECTS) $(INCFILES) Makefile
$(C++) -o $(LIBBILL) $(LDFLAGS) $(OBJECTS) $(C++_OBJECTS) -lm -lpsiu_for_cm -xprofile=tcov
and this makes the .o files
$(OBJECTS): $(INCFILES) Makefile $(FILES)
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(FILES)
the result of that is the brm can't start.
If someone is looking for an answer I found the solution. You have to use
-xprofile=tcov while compiling .o files and also when you links .so file ;)
Related
I have a sqlite extension file. The source is sqliteext/csv.c. When I build the lib with clang the output file is created at lib/csv.so.
cc -g -fPIC -I /usr/local/include -shared sqliteext/csv.c -o lib/csv.so
When I compile the lib using zig...
zig build-lib -I /usr/local/include -I /usr/include -I /usr/include/x86_64-linux-gnu --c-source sqliteext/csv.c -dynamic --output-dir lib
There are two problems.
zig prefixes the filename with a lib
zig add a version number thing in the suffix
so the output file is lib/libcsv.so.0.0.0
And what's interesting about this is that I need to change the filename in my extension loader (that's ok) but that I also need a symlink to handle the 0.0.0.
I'm still looking at the CLI help but I'm still not seeing the thing I need.
See https://github.com/ziglang/zig/issues/2230 and https://github.com/ziglang/zig/issues/2231
The former was fixed the same day as your post via https://github.com/ziglang/zig/pull/6315
I'm trying to add a .lo object file compiled through libtool with clang into a shared library file.
$ libtool --tag=CC --mode=compile clang -c newobject.c -shared
Is there an equivalent command to
$ ar r libmylib.a newobject.o
for shared libraries?
Alternatively, is there a way to dump all the .lo files that are already contained in a .so file so I can re-create tne shared library, say, using this command?
$ libtool --mode=link ld -soname libmylib.so -o libmylib.so.1 libmylib.so.0 newobject.o
There is no way to incrementally alter a shared library. You need all the component object files and rebuild the shared library from those each time.
I don't know of a way to extract object files from a shared library.
I am currently try to compile these files using HDF5
I have directly linked and included everything necessary ( I think) but still the compile unable to find the files that is needed
This is my Makefile:
CC = h5cc
FC = h5fc
LD = h5fc
FDEBUG = -std -g -traceback
CFLAGS = -g -O0 -Wall -pedantic
FFLAGS = -g -O0 -Wall -I$(H5DIR)/include -L$(H5DIR)/lib/libhdf5hl_fortran.a
LDFLAGS = -I$(H5DIR)/include -L$(H5DIR)/lib/libhdf5hl_fortran.a
#LDFLAGS = -I$(MKLROOT)/include -L$(MKLROOT) -mkl=sequential
# -opt-block-factor=16 -opt-prefetch=4 \
.SUFFIXES:
.SUFFIXES: .c .f .f90 .F90 .o
OBJS = timing.o \
kinds.o \
rw_matrix.o \
EXE = matmul_omp.exe
all: $(EXE)
$(EXE): $(OBJS) matmul_omp.o
$(LD) $(LDFLAGS) -o $# $^
.f90.o:
-$(RM) -f $*.o $*.mod
$(FC) $(FFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
.PHONEY: clean
clean:
THis is the err:
h5fc -I/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/include -L/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/lib/libhdf5hl_fortran.a -o matmul_omp.exe timing.o matmul_omp.o
gfortran: /usr/lib64/libhdf5hl_fortran.a: No such file or directory
gfortran: /usr/lib64/libhdf5_hl.a: No such file or directory
gfortran: /usr/lib64/libhdf5_fortran.a: No such file or directory
gfortran: /usr/lib64/libhdf5.a: No such file or directory
As you can see that I directly link libhdf5hl_fortran.a. but i dont know why the error is giving a different directory /usr/lib64/
I think you have a couple of things wrong here.
If you are using h5fc then you shouldn't need to add all the include and lib paths. That is the whole point of the helper applications.
You are adding the paths that have Intel, yet your h5fc has a GNU (gfortran) error.
The gfortran build of HDF5 looks as if it does not have the fortran bindings built.
I would suggest trying the following. Using the full paths (as you have done) but call ifort instead of h5fc:
ifort -I/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/include \
-L/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/lib/libhdf5hl_fortran.a \
-o matmul_omp.exe timing.o matmul_omp.o
I've downloaded lpeg source code from http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-0.12.tar.gz
How to get the dll? I can't do it with the makefile included. I'm using mingw32.
You can use this simple batch file running from lpeg folder:
set LUA_DIR=D:\lua-5.2
gcc -O2 -shared -s -I %LUA_DIR%\src -L %LUA_DIR%\src -o lpeg.dll lptree.c lpvm.c lpcap.c lpcode.c lpprint.c -llua52
Just set LUA_DIR folder to the folder with your Lua installation; it works with both Lua 5.1 and Lua 5.2.
First change the LUADIR variable to the correct location of your Lua include files. Then add the following make target (using the correct path to your Lua DLL):
mingw: $(FILES)
$(CC) $(CFLAGS) -shared $(FILES) -o lpeg.dll C:\path\to\lua52.dll
I also had to change CC from gcc to mingw32-gcc, but that might just be my broken MinGW installation.
make mingw
should work now.
I am trying to include the path to extra libraries in my makefile, but I can't figure out how to get the compiler to use that path. so far I have:
g++ -g -Wall testing.cpp fileparameters.cpp main.cpp -o test
and I want to include the path to
/data[...]/lib
because testing.cpp includes files from that library. Also, I'm on a linux machine.
EDIT: Not a path to a library. Just to files that were included. My bad.
To specify a directory to search for (binary) libraries, you just use -L:
-L/data[...]/lib
To specify the actual library name, you use -l:
-lfoo # (links libfoo.a or libfoo.so)
To specify a directory to search for include files (different from libraries!) you use -I:
-I/data[...]/lib
So I think what you want is something like
g++ -g -Wall -I/data[...]/lib testing.cpp fileparameters.cpp main.cpp -o test
These compiler flags (amongst others) can also be found at the GNU GCC Command Options manual:
3.16 Options for Directory Search
In your MakeFile or CMakeLists.txt you can set CMAKE_CXX_FLAGS as below:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/path/to/your/folder")
Alternatively you could setup environment variables.
Suppose you are using bash, then in ~/.bashrc, write
C_INCLUDE_PATH="/data/.../lib/:$C_INCLUDE_PATH" ## for C compiler
CPLUS_INCLUDE_PATH="/data/.../lib/:$CPLUS_INCLUDE_PATH" ## for Cpp compiler
export C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH
and source it with source ~/.bashrc.
You should be good to go.