Getting error: "nvlink error : Undefined reference to '_ZN8Strategy8backtestEPddd'" - c++

I am getting the following error when running make for my CUDA (v7.5) application:
nvlink error : Undefined reference to '_ZN8Strategy8backtestEPddd'
I'm not sure why. It seems something is likely wrong with my Makefile. Here it is -- any ideas what might be causing the error? Thank you in advance!
CC = nvcc
CFLAGS = -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field
LFLAGS = -L/usr/local/lib -Llib $(shell pkg-config --libs libmongoc-1.0 libbson-1.0)
INCLUDES = -I/usr/include -I/usr/local/include -Iinclude $(shell pkg-config --cflags libmongoc-1.0 libbson-1.0)
LIBS = -lgsl -lcblas
BIN = ./bin
OBJDIR = ./obj
OBJ = factories/optimizationStrategyFactory.o positions/callPosition.o positions/putPosition.o \
positions/position.o strategies/reversalsOptimizationStrategy.o strategies/optimizationStrategy.o \
strategies/strategy.o factories/optimizerFactory.o optimizers/reversalsOptimizer.o optimizers/optimizer.o \
factories/dataParserFactory.o dataParsers/oandaDataParser.o dataParsers/dataParser.o \
studies/study.o studies/smaStudy.o studies/emaStudy.o studies/rsiStudy.o \
studies/stochasticOscillatorStudy.o studies/polynomialRegressionChannelStudy.o
all: prepareData optimize
prepareData: src/prepareData.cu $(addprefix lib/,$(OBJ))
#mkdir -p $(BIN)
$(CC) $(CFLAGS) $(INCLUDES) -o $(BIN)/$# src/prepareData.cu $(addprefix $(OBJDIR)/,$(addprefix lib/,$(OBJ))) $(LFLAGS) $(LIBS)
optimize: src/optimize.cu $(addprefix lib/,$(OBJ))
#mkdir -p $(BIN)
$(CC) $(CFLAGS) $(INCLUDES) -o $(BIN)/$# src/optimize.cu $(addprefix $(OBJDIR)/,$(addprefix lib/,$(OBJ))) $(LFLAGS) $(LIBS)
%.o: %.cu
#mkdir -p $(OBJDIR)/lib/strategies $(OBJDIR)/lib/positions $(OBJDIR)/lib/factories $(OBJDIR)/lib/optimizers $(OBJDIR)/lib/dataParsers $(OBJDIR)/lib/studies
$(CC) $(CFLAGS) $(INCLUDES) -o $(OBJDIR)/$# --device-c $<
clean:
rm -rf $(BIN) $(OBJDIR)
And here is the full compiler output:
rm -rf ./bin ./obj
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/factories/optimizationStrategyFactory.o --device-c lib/factories/optimizationStrategyFactory.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/positions/callPosition.o --device-c lib/positions/callPosition.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/positions/putPosition.o --device-c lib/positions/putPosition.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/positions/position.o --device-c lib/positions/position.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/strategies/reversalsOptimizationStrategy.o --device-c lib/strategies/reversalsOptimizationStrategy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/strategies/optimizationStrategy.o --device-c lib/strategies/optimizationStrategy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/strategies/strategy.o --device-c lib/strategies/strategy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/factories/optimizerFactory.o --device-c lib/factories/optimizerFactory.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/optimizers/reversalsOptimizer.o --device-c lib/optimizers/reversalsOptimizer.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/optimizers/optimizer.o --device-c lib/optimizers/optimizer.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/factories/dataParserFactory.o --device-c lib/factories/dataParserFactory.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/dataParsers/oandaDataParser.o --device-c lib/dataParsers/oandaDataParser.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/dataParsers/dataParser.o --device-c lib/dataParsers/dataParser.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/studies/study.o --device-c lib/studies/study.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/studies/smaStudy.o --device-c lib/studies/smaStudy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/studies/emaStudy.o --device-c lib/studies/emaStudy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/studies/rsiStudy.o --device-c lib/studies/rsiStudy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/studies/stochasticOscillatorStudy.o --device-c lib/studies/stochasticOscillatorStudy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./obj/lib/studies/polynomialRegressionChannelStudy.o --device-c lib/studies/polynomialRegressionChannelStudy.cu
nvcc -std=c++11 -m64 -arch=compute_35 -code=sm_35 --compiler-options=-Wall,-Wno-unused-function,-Wno-unused-local-typedef,-Wno-unused-private-field -I/usr/include -I/usr/local/include -Iinclude -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -o ./bin/prepareData src/prepareData.cu ./obj/lib/factories/optimizationStrategyFactory.o ./obj/lib/positions/callPosition.o ./obj/lib/positions/putPosition.o ./obj/lib/positions/position.o ./obj/lib/strategies/reversalsOptimizationStrategy.o ./obj/lib/strategies/optimizationStrategy.o ./obj/lib/strategies/strategy.o ./obj/lib/factories/optimizerFactory.o ./obj/lib/optimizers/reversalsOptimizer.o ./obj/lib/optimizers/optimizer.o ./obj/lib/factories/dataParserFactory.o ./obj/lib/dataParsers/oandaDataParser.o ./obj/lib/dataParsers/dataParser.o ./obj/lib/studies/study.o ./obj/lib/studies/smaStudy.o ./obj/lib/studies/emaStudy.o ./obj/lib/studies/rsiStudy.o ./obj/lib/studies/stochasticOscillatorStudy.o ./obj/lib/studies/polynomialRegressionChannelStudy.o -L/usr/local/lib -Llib -L/usr/local/lib -lsasl2 -lssl -lcrypto -lz -lmongoc-1.0 -lbson-1.0 -lgsl -lcblas
nvlink info : Function '_ZN12CallPosition13getProfitLossEv' has address taken but no possible call to it
nvlink info : Function '_ZN12CallPosition18getTransactionTypeEv' has address taken but no possible call to it
nvlink info : Function '_ZN11PutPosition13getProfitLossEv' has address taken but no possible call to it
nvlink info : Function '_ZN11PutPosition18getTransactionTypeEv' has address taken but no possible call to it
nvlink info : Function '_ZN8PositionD1Ev' has address taken but no possible call to it
nvlink info : Function '_ZN8PositionD0Ev' has address taken but no possible call to it
nvlink info : Function '_ZN12CallPositionD1Ev' has address taken but no possible call to it
nvlink info : Function '_ZN12CallPositionD0Ev' has address taken but no possible call to it
nvlink info : Function '_ZN11PutPositionD1Ev' has address taken but no possible call to it
nvlink info : Function '_ZN11PutPositionD0Ev' has address taken but no possible call to it
nvlink info : Function '_ZN29ReversalsOptimizationStrategy8backtestEPddd' has address taken but no possible call to it
nvlink info : Function '_ZN20OptimizationStrategy4tickEPd' has address taken but no possible call to it
nvlink info : Function '_ZN8Strategy8backtestEPddd' has address taken but no possible call to it
nvlink error : Undefined reference to '_ZN8Strategy8backtestEPddd' in './obj/lib/strategies/optimizationStrategy.o'
make: *** [prepareData] Error 255
Note this started happening around the time I added --device-c (which some code changes require).

Turns out objects passed to CUDA kernels cannot have virtual functions. See this thread.
However, it seems that objects instantiated and used only within the kernel can have virtual functions.

Related

undefined reference to `__cudaPopCallConfiguration'

I am trying to compile a cuda code that I have received from Github (https://github.com/exafmm/exafmm-alpha).
The Makefile.include contains:
.SUFFIXES: .cxx .cu .f90 .o
.PHONY: docs
CUDA_INSTALL_PATH = /usr/local/cuda
#DEVICE = cpu
DEVICE = gpu
CXX = mpicxx -g -O3 -lstdc++ -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include
NVCC = nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include
FC = mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include
FCC = mpif90 -c -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include
LFLAGS = -D$(DEVICE) -lstdc++ -ldl -lm
LFLAGS += -lmpi_cxx
LFLAGS += -lpthread
ifeq ($(DEVICE),gpu)
LFLAGS += -lcudart
endif
OBJECT = ../kernel/$(DEVICE)Laplace.o ../kernel/$(DEVICE)BiotSavart.o\
../kernel/$(DEVICE)Stretching.o ../kernel/$(DEVICE)Gaussian.o\
../kernel/$(DEVICE)CoulombVdW.o
.cxx.o:
$(CXX) -c $? -o $# $(LFLAGS)
.cu.o:
$(NVCC) -c $? -o $# $(LFLAGS)
.f90.o:
$(FC) -c $? -o $#
And the Makefile is:
include ../Makefile.include
lib_parallel_ij: parallel_wrapper_ij.o $(OBJECT)
ar -cr libfmm.a parallel_wrapper_ij.o $(OBJECT)
ranlib libfmm.a
test_parallel_ij: test_parallel_ij.o
make lib_parallel_ij
$(FC) $? -L. -lfmm $(LFLAGS)
mpirun -np 2 ./a.out
When I tried to compile the code, I get the following errors.
mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include -c test_parallel_ij.f90 -o test_parallel_ij.o
make lib_parallel_ij
make[1]: Entering directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
mpicxx -g -O3 -lstdc++ -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c parallel_wrapper_ij.cxx -o parallel_wrapper_ij.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuLaplace.cu -o ../kernel/gpuLaplace.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuBiotSavart.cu -o ../kernel/gpuBiotSavart.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
../kernel/gpuBiotSavart.cu(542): warning #177-D: variable "SQRT4PI" was declared but never referenced
../kernel/gpuBiotSavart.cu(548): warning #550-D: variable "r" was set but never used
nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuStretching.cu -o ../kernel/gpuStretching.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuGaussian.cu -o ../kernel/gpuGaussian.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuCoulombVdW.cu -o ../kernel/gpuCoulombVdW.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
ar -cr libfmm.a parallel_wrapper_ij.o ../kernel/gpuLaplace.o ../kernel/gpuBiotSavart.o ../kernel/gpuStretching.o ../kernel/gpuGaussian.o ../kernel/gpuCoulombVdW.o
ranlib libfmm.a
make[1]: Leaving directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include test_parallel_ij.o -L. -lfmm -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
./libfmm.a(gpuLaplace.o): In function `LaplaceL2P_GPU(int*, int*, double*, double*)':
tmpxft_0000397c_00000000-6_gpuLaplace.cudafe1.cpp:(.text+0xc2): undefined reference to `__cudaPopCallConfiguration'
....
./libfmm.a(gpuLaplace.o): In function `Kernel::LaplaceL2P()':
tmpxft_0000397c_00000000-6_gpuLaplace.cudafe1.cpp:(.text+0x3e06): undefined reference to `__cudaPushCallConfiguration'
....
./libfmm.a(gpuCoulombVdW.o): In function `__sti____cudaRegisterAll()':
tmpxft_00003a87_00000000-6_gpuCoulombVdW.cudafe1.cpp:(.text.startup+0x189): undefined reference to `__cudaRegisterFatBinaryEnd'
....
I tried to find the installation of cuda:
whereis cuda
cuda: /usr/lib/cuda /usr/include/cuda.h /usr/local/cuda
I could not fix the error, can anyone give any hint to fix it?
Thank you.

How to rectify `undefined reference to `MPI::Comm::Comm()'` when compiling with Makefile?

I am trying to compile a code by Makefile. I received the code from github. I tried to implement the solution from links:
[https://github.com/LLNL/scr/issues/130][1]
[https://stackoverflow.com/questions/62461718/mpi-complile-error-undefined-reference-to-mpiwinfree][2], etc.
These solutions are not working for me or they are too technical. I am sorry to say as I am not from a programming background, it is difficult for me to understand.
The make file are as follows:
Makefile.include
.SUFFIXES: .cxx .cu .f90 .o
.PHONY: docs
CUDA_INSTALL_PATH = /usr/local/cuda
DEVICE = cpu
#~ DEVICE = gpu
CXX = mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include
NVCC = nvcc -Xcompiler "-fopenmp -O3" -std=c++11 -use_fast_math -I../include
FC = mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include
LFLAGS = -D$(DEVICE) -lstdc++ -ldl -lm
#~ LFLAGS += -lmpi_cxx
ifeq ($(DEVICE),gpu)
LFLAGS += -lcudart
endif
OBJECT = ../kernel/$(DEVICE)Laplace.o ../kernel/$(DEVICE)BiotSavart.o\
../kernel/$(DEVICE)Stretching.o ../kernel/$(DEVICE)Gaussian.o\
../kernel/$(DEVICE)CoulombVdW.o
.cxx.o:
$(CXX) -c $? -o $# $(LFLAGS)
.cu.o:
$(NVCC) -c $? -o $# $(LFLAGS)
.f90.o:
$(FC) -c $? -o $#
and Makefile:
include ../Makefile.include
lib_parallel_ij: parallel_wrapper_ij.o $(OBJECT)
ar -cr libfmm.a parallel_wrapper_ij.o $(OBJECT)
ranlib libfmm.a
test_parallel_ij: test_parallel_ij.o
make lib_parallel_ij
$(FC) $? -L. -lfmm $(LFLAGS)
mpirun -np 2 ./a.out
clean:
make -C .. clean
When I am trying to compile it. It gives me the following errors:
mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include -c test_parallel_ij.f90 -o test_parallel_ij.o
make lib_parallel_ij
make[1]: Entering directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c parallel_wrapper_ij.cxx -o parallel_wrapper_ij.o -Dcpu -lstdc++ -ldl -lm
mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuLaplace.cxx -o ../kernel/cpuLaplace.o -Dcpu -lstdc++ -ldl -lm
mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuBiotSavart.cxx -o ../kernel/cpuBiotSavart.o -Dcpu -lstdc++ -ldl -lm
mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuStretching.cxx -o ../kernel/cpuStretching.o -Dcpu -lstdc++ -ldl -lm
mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuGaussian.cxx -o ../kernel/cpuGaussian.o -Dcpu -lstdc++ -ldl -lm
mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuCoulombVdW.cxx -o ../kernel/cpuCoulombVdW.o -Dcpu -lstdc++ -ldl -lm
ar -cr libfmm.a parallel_wrapper_ij.o ../kernel/cpuLaplace.o ../kernel/cpuBiotSavart.o ../kernel/cpuStretching.o ../kernel/cpuGaussian.o ../kernel/cpuCoulombVdW.o
ranlib libfmm.a
make[1]: Leaving directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include test_parallel_ij.o -L. -lfmm -Dcpu -lstdc++ -ldl -lm
./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/op_inln.h:121: undefined reference to `ompi_mpi_cxx_op_intercept'
./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Intracomm::Clone() const':
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined reference to `MPI::Comm::Comm()'
./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Graphcomm::Clone() const':
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Cartcomm::Sub(bool const*) const':
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const':
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Cartcomm::Clone() const':
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
./libfmm.a(parallel_wrapper_ij.o):/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: more undefined references to `MPI::Comm::Comm()' follow
./libfmm.a(parallel_wrapper_ij.o):(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
./libfmm.a(parallel_wrapper_ij.o):(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
collect2: error: ld returned 1 exit status
Makefile:48: recipe for target 'test_parallel_ij' failed
make: *** [test_parallel_ij] Error 1
I am unable to solve the error. I couldn't compile the code. I will be greatly helped if I can get some clue to compile it.
Thanks a lot.
[1]: https://github.com/LLNL/scr/issues/130
[2]: MPI complile error, undefined reference to `MPI::Win::Free()

Makefile undefined reference to my namespace objects/functions/constructors

My code compiles well in codeblocks, but my makefile can't compile because of undefined reference to items with my namespace Chess
how should i specify the namespace in makefile or fix it?
here's the errors example:
King.cpp:35: undefined reference to `Chess::Board::getPiece(Chess::Position const&) const'
here's my makefile
CXXFLAGS = -ISFML-2.4.2/include -std=c++11
LXXFLAGS = -LSFML-2.4.2/lib -lsfml-graphics-d -lsfml-audio-d -lsfml-network-d -lsfml-window-d -lsfml-system-d -std=c++11
main.exe: main.o bishop.o king.o knight.o pawn.o position.o queen.o rook.o gui.o piece.o board.o Bishop.hpp Board.hpp
g++ -std=c++11 main.o bishop.o king.o knight.o pawn.o position.o queen.o rook.o gui.o piece.o -o main $(LXXFLAGS)
main.o: main.cpp GUI.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 main.cpp -c $(CXXFLAGS)
bishop.o: Bishop.cpp Bishop.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Bishop.cpp -c $(CXXFLAGS)
king.o: King.cpp King.hpp Rook.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 King.cpp -c $(CXXFLAGS)
pawn.o: Pawn.cpp Pawn.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Pawn.cpp -c $(CXXFLAGS)
position.o: Position.cpp Position.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Position.cpp -c $(CXXFLAGS)
queen.o: Queen.cpp Queen.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Queen.cpp -c $(CXXFLAGS)
rook.o: Rook.cpp Rook.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Rook.cpp -c $(CXXFLAGS)
knight.o: Knight.cpp Knight.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Knight.cpp -c $(CXXFLAGS)
gui.o: GUI.cpp GUI.hpp Queen.hpp Rook.hpp Bishop.hpp Knight.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 GUI.cpp -c $(CXXFLAGS)
piece.o: Piece.cpp Piece.hpp Board.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Piece.cpp -c $(CXXFLAGS)
board.o: Board.cpp Board.hpp Pawn.hpp Rook.hpp Knight.hpp Queen.hpp King.hpp
g++ -fexceptions -g -std=c++11 -std=c++11 Board.cpp -c $(CXXFLAGS)
You forgot to include board.o when compiling main.exe

Confusion with Makefile linking a library that seems to link but I can't call

I am trying yo build a Makefile for a project that uses the soplex library (which also depends on libz and libgmp).
So I have this little Makefile:
SOPLEXPATH =../../lib/soplex-3.0.0/lib/
SOPLEXINCLUDE =../../lib/soplex-3.0.0/src/
SOPLEXDEP =../../lib/soplex-3.0.0/src/
CC = g++
CPPFLAGS = -g -std=c++0x -O3 -I $(SOPLEXINCLUDE)
#CPPFLAGS += -DNDEBUG
CPPFLAGS += -pg -ggdb
CPPFLAGS += -Wall -Werror=return-type
LIBS = -L $(SOPLEXPATH) -lz -lgmp -lsoplex
SRCS = $(wildcard ./src/core/*.cpp)
OBJS = $(addsuffix .o, $(basename $(SRCS)))
DEPS = $(addsuffix .d, $(basename $(SRCS)))
all : kea
kea : $(OBJS)
$(CC) $(CPPFLAGS) $(LIBS) -o bin/kea-core $(OBJS)
clean :
rm -f bin/kea-core $(OBJS) $(DEPS) *~
-include $(DEPS)
%.d: %.c
#$(CC) -MM -MT $(subst .d,.o,$#) -MT $# $(CPPFLAGS) $< > $#
And all seems to compile to object files (.o) correctly, but then the linker complains about not finding the function soplex::SoPlex::SoPlex() (the constructor of SoPlex):
g++ -g -std=c++0x -O3 -I ../../lib/soplex-3.0.0/src/ -pg -ggdb -Wall -Werror=return-type -c -o src/core/ecircuit.o src/core/ecircuit.cpp
g++ -g -std=c++0x -O3 -I ../../lib/soplex-3.0.0/src/ -pg -ggdb -Wall -Werror=return-type -c -o src/core/solver_soplex.o src/core/solver_soplex.cpp
g++ -g -std=c++0x -O3 -I ../../lib/soplex-3.0.0/src/ -pg -ggdb -Wall -Werror=return-type -c -o src/core/main.o src/core/main.cpp
g++ -g -std=c++0x -O3 -I ../../lib/soplex-3.0.0/src/ -pg -ggdb -Wall -Werror=return-type -L ../../lib/soplex-3.0.0/lib/ -lz -lgmp -lsoplex -o bin/kea-core ./src/core/ecircuit.o ./src/core/solver_soplex.o ./src/core/main.o
./src/core/solver_soplex.o: In function `SolvSoplex::SolvSoplex(ECircuit&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >&, SolvSoplex::Mode)':
/home/diego/Projects/kea-landscape-tool/src/core/solver_soplex.cpp:9: undefined reference to `soplex::SoPlex::SoPlex()'
/home/diego/Projects/kea-landscape-tool/src/core/solver_soplex.cpp:9: undefined reference to `soplex::SoPlex::~SoPlex()'
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'kea' failed
make: *** [kea] Error 1
Since all the .o files are created I tried to compile by hand doing:
g++ -g -std=c++0x -O3 -I ../../lib/soplex-3.0.0/src/ -Wall -Werror=return-type -pg -ggdb -L/home/diego/Projects/kea-landscape-tool/../../lib/soplex-3.0.0/lib/ -lsoplex -lz -lgmp -o bin/kea-core src/core/main.o src/core/ecircuit.o src/core/solver_soplex.o
And it failed with the same error.
then I tried switching the position of the -L and -l.. flags like this, and it compiled: g++ -g -std=c++0x -O3 -I ../../lib/soplex-3.0.0/src/ -Wall -Werror=return-type -pg -ggdb -o bin/kea-core src/core/main.o src/core/ecircuit.o src/core/solver_soplex.o -L/home/diego/Projects/kea-landscape-tool/../../lib/soplex-3.0.0/lib/ -lsoplex -lz -lgmp
Seeing that, I tried to change the rule in the Makefile as follows:
kea : $(OBJS)
$(CC) $(CPPFLAGS) -o bin/kea-core $(OBJS) $(LIBS)
But it just failed miserably triggering about 100 errors all inside soplex.cpp (as in, it depends on -lgmp and -lz, but it could not find them? Too long to paste here)
I am pretty confused, any idea on how to fix this?
thanks.
Try putting the $LIBS at the end of the command.
Change this:
LIBS = -L $(SOPLEXPATH) -lz -lgmp -lsoplex
Into this:
LIBS = -L $(SOPLEXPATH) -lsoplex -lgmp -lz
You always need to put B after A, if A calls functions in B. With static libraries as least.

Find the Linking error in this Makefile

I'm trying to compile this piece of software called Register3D_wx but have problems when trying to run make. I have installed Open GSL, Open GL and wxWidgets library as required. When I cd into the folder and run make, I get lots of error messages. I'm giving some of the output:
james#james-HP-Z420-Workstation:~/Downloads/Register3D_wx_1.1.1$ sudo make
test -d bin/Release || mkdir -p bin/Release
test -d obj/Release/ann_1.1.2/src || mkdir -p obj/Release/ann_1.1.2/src
test -d obj/Release/ || mkdir -p obj/Release/
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/kd_pr_search.cpp -o obj/Release/ann_1.1.2/src/kd_pr_search.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ZPR.cc -o obj/Release/ZPR.o
ZPR.cc: In member function ‘void ZPR::ZprPick(GLdouble, GLdouble, GLdouble, GLdouble)’:
ZPR.cc:424:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (buffer[j+1]<minZ)
^
ZPR.cc:380:11: warning: variable ‘min’ set but not used [-Wunused-but-set-variable]
GLint min = -1;
^
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/ANN.cpp -o obj/Release/ann_1.1.2/src/ANN.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/bd_fix_rad_search.cpp -o obj/Release/ann_1.1.2/src/bd_fix_rad_search.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/bd_pr_search.cpp -o obj/Release/ann_1.1.2/src/bd_pr_search.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/bd_search.cpp -o obj/Release/ann_1.1.2/src/bd_search.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/bd_tree.cpp -o obj/Release/ann_1.1.2/src/bd_tree.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/brute.cpp -o obj/Release/ann_1.1.2/src/brute.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/kd_dump.cpp -o obj/Release/ann_1.1.2/src/kd_dump.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/kd_fix_rad_search.cpp -o obj/Release/ann_1.1.2/src/kd_fix_rad_search.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c PointOP.cc -o obj/Release/PointOP.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/kd_search.cpp -o obj/Release/ann_1.1.2/src/kd_search.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/kd_split.cpp -o obj/Release/ann_1.1.2/src/kd_split.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/kd_tree.cpp -o obj/Release/ann_1.1.2/src/kd_tree.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/kd_util.cpp -o obj/Release/ann_1.1.2/src/kd_util.o
g++ -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ann_1.1.2/src/perf.cpp -o obj/Release/ann_1.1.2/src/perf.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c main.cc -o obj/Release/main.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c MainWindow.cc -o obj/Release/MainWindow.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c Cylinder.cc -o obj/Release/Cylinder.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c GLCanvas.cc -o obj/Release/GLCanvas.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c Help.cc -o obj/Release/Help.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ICP.cc -o obj/Release/ICP.o
ICP.cc: In member function ‘void ICP::SetPoints(std::vector<Point>&, std::vector<Point>&, float)’:
ICP.cc:439:73: warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘std::vector<Point>::size_type {aka long unsigned int}’ [-Wformat=]
printf("Number of points after downsampling: %i\n", m_points2.size());
^
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c ICPDialog.cc -o obj/Release/ICPDialog.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c About.cc -o obj/Release/About.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c Math2.cc -o obj/Release/Math2.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c Matrix.cc -o obj/Release/Matrix.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c Misc.cc -o obj/Release/Misc.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c MyANN.cc -o obj/Release/MyANN.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c OGLWrapper.cc -o obj/Release/OGLWrapper.o
gcc -O2 -Wall `wx-config --cflags` `gsl-config --cflags` -Iann_1.1.2/include -c Point.cc -o obj/Release/Point.o
g++ -s `wx-config --libs` `wx-config --libs gl` `gsl-config --libs` -Lann_1.1.2/include obj/Release/ann_1.1.2/src/kd_pr_search.o obj/Release/ZPR.o obj/Release/ann_1.1.2/src/ANN.o obj/Release/ann_1.1.2/src/bd_fix_rad_search.o obj/Release/ann_1.1.2/src/bd_pr_search.o obj/Release/ann_1.1.2/src/bd_search.o obj/Release/ann_1.1.2/src/bd_tree.o obj/Release/ann_1.1.2/src/brute.o obj/Release/ann_1.1.2/src/kd_dump.o obj/Release/ann_1.1.2/src/kd_fix_rad_search.o obj/Release/PointOP.o obj/Release/ann_1.1.2/src/kd_search.o obj/Release/ann_1.1.2/src/kd_split.o obj/Release/ann_1.1.2/src/kd_tree.o obj/Release/ann_1.1.2/src/kd_util.o obj/Release/ann_1.1.2/src/perf.o obj/Release/main.o obj/Release/MainWindow.o obj/Release/Cylinder.o obj/Release/GLCanvas.o obj/Release/Help.o obj/Release/ICP.o obj/Release/ICPDialog.o obj/Release/About.o obj/Release/Math2.o obj/Release/Matrix.o obj/Release/Misc.o obj/Release/MyANN.o obj/Release/OGLWrapper.o obj/Release/Point.o -lz -lGLEW -lGL -lglut -o bin/Release/Register3D_wx
obj/Release/ICP.o: In function `ICP::SetPoints(std::vector<Point, std::allocator<Point> >&, std::vector<Point, std::allocator<Point> >&, float)':
ICP.cc:(.text+0x38c): undefined reference to `wxStringBase::npos'
ICP.cc:(.text+0x3a4): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)'
ICP.cc:(.text+0x49a): undefined reference to `wxString::Format(wchar_t const*, ...)'
ICP.cc:(.text+0x593): undefined reference to `wxStringBase::npos'
ICP.cc:(.text+0x5ab): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)'
ICP.cc:(.text+0x614): undefined reference to `wxString::Format(wchar_t const*, ...)'
ICP.cc:(.text+0x6d9): undefined reference to `wxStringBase::npos'
ICP.cc:(.text+0x6f1): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)'
ICP.cc:(.text+0x7da): undefined reference to `wxString::Format(wchar_t const*, ...)'
I know I need to edit the Makefile but that's where I am stuck. I do have some experience with makesfiles but don't know what to do. Moreover, all the dependencies are are complied and the object files produced so I don't know why ICP.cc is having this undefined reference error. The makefile is:
#------------------------------------------------------------------------------#
# This makefile was generated by 'cbp2make' tool rev.107 #
#------------------------------------------------------------------------------#
WRKDIR = `pwd`
CC = gcc
CXX = g++
AR = ar
LD = g++
WINDRES = windres
INC = -Iann_1.1.2/include
CFLAGS =
RESINC =
LIBDIR = -Lann_1.1.2/include
LIB =
LDFLAGS =
INC_RELEASE = $(INC)
CFLAGS_RELEASE = $(CFLAGS) -O2 -Wall `wx-config --cflags` `gsl-config --cflags`
RESINC_RELEASE = $(RESINC)
RCFLAGS_RELEASE = $(RCFLAGS)
LIBDIR_RELEASE = $(LIBDIR)
LIB_RELEASE = $(LIB) -lz -lGLEW -lGL -lglut
LDFLAGS_RELEASE = $(LDFLAGS) -s `wx-config --libs` `wx-config --libs gl` `gsl-config --libs`
OBJDIR_RELEASE = obj/Release
DEP_RELEASE =
OUT_RELEASE = bin/Release/Register3D_wx
OBJ_RELEASE = $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_pr_search.o $(OBJDIR_RELEASE)/ZPR.o $(OBJDIR_RELEASE)/ann_1.1.2/src/ANN.o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_fix_rad_search.o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_pr_search.o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_search.o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_tree.o $(OBJDIR_RELEASE)/ann_1.1.2/src/brute.o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_dump.o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_fix_rad_search.o $(OBJDIR_RELEASE)/PointOP.o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_search.o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_split.o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_tree.o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_util.o $(OBJDIR_RELEASE)/ann_1.1.2/src/perf.o $(OBJDIR_RELEASE)/main.o $(OBJDIR_RELEASE)/MainWindow.o $(OBJDIR_RELEASE)/Cylinder.o $(OBJDIR_RELEASE)/GLCanvas.o $(OBJDIR_RELEASE)/Help.o $(OBJDIR_RELEASE)/ICP.o $(OBJDIR_RELEASE)/ICPDialog.o $(OBJDIR_RELEASE)/About.o $(OBJDIR_RELEASE)/Math2.o $(OBJDIR_RELEASE)/Matrix.o $(OBJDIR_RELEASE)/Misc.o $(OBJDIR_RELEASE)/MyANN.o $(OBJDIR_RELEASE)/OGLWrapper.o $(OBJDIR_RELEASE)/Point.o
all: Release
clean: clean_Release
before_Release:
test -d bin/Release || mkdir -p bin/Release
test -d $(OBJDIR_RELEASE)/ann_1.1.2/src || mkdir -p $(OBJDIR_RELEASE)/ann_1.1.2/src
test -d $(OBJDIR_RELEASE)/ || mkdir -p $(OBJDIR_RELEASE)/
after_Release:
Release: before_Release out_Release after_Release
out_Release: $(OBJ_RELEASE) $(DEP_RELEASE)
$(LD) $(LDFLAGS_RELEASE) $(LIBDIR_RELEASE) $(OBJ_RELEASE) $(LIB_RELEASE) -o $(OUT_RELEASE)
$(OBJDIR_RELEASE)/ann_1.1.2/src/kd_pr_search.o: ann_1.1.2/src/kd_pr_search.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/kd_pr_search.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_pr_search.o
$(OBJDIR_RELEASE)/ZPR.o: ZPR.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ZPR.cc -o $(OBJDIR_RELEASE)/ZPR.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/ANN.o: ann_1.1.2/src/ANN.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/ANN.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/ANN.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/bd_fix_rad_search.o: ann_1.1.2/src/bd_fix_rad_search.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/bd_fix_rad_search.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_fix_rad_search.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/bd_pr_search.o: ann_1.1.2/src/bd_pr_search.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/bd_pr_search.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_pr_search.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/bd_search.o: ann_1.1.2/src/bd_search.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/bd_search.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_search.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/bd_tree.o: ann_1.1.2/src/bd_tree.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/bd_tree.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/bd_tree.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/brute.o: ann_1.1.2/src/brute.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/brute.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/brute.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/kd_dump.o: ann_1.1.2/src/kd_dump.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/kd_dump.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_dump.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/kd_fix_rad_search.o: ann_1.1.2/src/kd_fix_rad_search.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/kd_fix_rad_search.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_fix_rad_search.o
$(OBJDIR_RELEASE)/PointOP.o: PointOP.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c PointOP.cc -o $(OBJDIR_RELEASE)/PointOP.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/kd_search.o: ann_1.1.2/src/kd_search.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/kd_search.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_search.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/kd_split.o: ann_1.1.2/src/kd_split.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/kd_split.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_split.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/kd_tree.o: ann_1.1.2/src/kd_tree.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/kd_tree.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_tree.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/kd_util.o: ann_1.1.2/src/kd_util.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/kd_util.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/kd_util.o
$(OBJDIR_RELEASE)/ann_1.1.2/src/perf.o: ann_1.1.2/src/perf.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ann_1.1.2/src/perf.cpp -o $(OBJDIR_RELEASE)/ann_1.1.2/src/perf.o
$(OBJDIR_RELEASE)/main.o: main.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c main.cc -o $(OBJDIR_RELEASE)/main.o
$(OBJDIR_RELEASE)/MainWindow.o: MainWindow.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c MainWindow.cc -o $(OBJDIR_RELEASE)/MainWindow.o
$(OBJDIR_RELEASE)/Cylinder.o: Cylinder.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Cylinder.cc -o $(OBJDIR_RELEASE)/Cylinder.o
$(OBJDIR_RELEASE)/GLCanvas.o: GLCanvas.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c GLCanvas.cc -o $(OBJDIR_RELEASE)/GLCanvas.o
$(OBJDIR_RELEASE)/Help.o: Help.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Help.cc -o $(OBJDIR_RELEASE)/Help.o
$(OBJDIR_RELEASE)/ICP.o: ICP.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ICP.cc -o $(OBJDIR_RELEASE)/ICP.o
$(OBJDIR_RELEASE)/ICPDialog.o: ICPDialog.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ICPDialog.cc -o $(OBJDIR_RELEASE)/ICPDialog.o
$(OBJDIR_RELEASE)/About.o: About.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c About.cc -o $(OBJDIR_RELEASE)/About.o
$(OBJDIR_RELEASE)/Math2.o: Math2.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Math2.cc -o $(OBJDIR_RELEASE)/Math2.o
$(OBJDIR_RELEASE)/Matrix.o: Matrix.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Matrix.cc -o $(OBJDIR_RELEASE)/Matrix.o
$(OBJDIR_RELEASE)/Misc.o: Misc.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Misc.cc -o $(OBJDIR_RELEASE)/Misc.o
$(OBJDIR_RELEASE)/MyANN.o: MyANN.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c MyANN.cc -o $(OBJDIR_RELEASE)/MyANN.o
$(OBJDIR_RELEASE)/OGLWrapper.o: OGLWrapper.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c OGLWrapper.cc -o $(OBJDIR_RELEASE)/OGLWrapper.o
$(OBJDIR_RELEASE)/Point.o: Point.cc
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Point.cc -o $(OBJDIR_RELEASE)/Point.o
clean_Release:
rm -f $(OBJ_RELEASE) $(OUT_RELEASE)
rm -rf $(OBJDIR_RELEASE)/ann_1.1.2/src
rm -rf $(OBJDIR_RELEASE)/
.PHONY: before_Release after_Release clean_Release
I see two potential problems here:
You should use wx-config --libs std,gl to link with all normal wxWidgets libraries and wxWidgets OpenGL library instead of just the latter.
You should ensure that in your link command LDFLAGS_RELEASE comes after the object files, this is important if you're using static wxWidgets libraries.