Running mtouch with --embeddinator flag on a dll giving error Undefined symbols for architecture arm64: "_xamarin_embeddinator_initialize" - xamarin.ios

I am trying to create a .framework from .net library using monotouch option --embeddinator. In the process I am getting below error
Undefined symbols for architecture arm64:
"_xamarin_embeddinator_initialize", referenced from:
native_to_managed_trampoline_1(objc_object*, objc_selector*, _MonoMethod**, int, int, unsigned int) in registrar.o
native_to_managed_trampoline_2(objc_object*, objc_selector*, _MonoMethod**, void*, unsigned int) in registrar.o
native_to_managed_trampoline_3(objc_object*, objc_selector*, _MonoMethod**, bool*, unsigned int) in registrar.o
native_to_managed_trampoline_4(objc_object*, objc_selector*, _MonoMethod**, objc_object*, unsigned int) in registrar.o ld: symbol(s) not found for architecture arm64
Here is the command I am trying to run
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --dev /Users/mihirdas/Working/XamEmbed/XamEmbed/XamEmbed/bin/Release --abi=arm64 --sdkroot /Applications/Xcode.app --targetver 8.0 --dsym:false --msym:false --embeddinator XamEmbed.dll --reference=/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --sdk 15.2 --linksdkonly --registrar:static --cache /Users/mihirdas/Working/XamEmbed/XamEmbed/XamEmbed/bin/Release/iOS/iPhoneOS/build-cache --assembly-build-target=#all=framework=XamEmbed.iOS.framework --target-framework Xamarin.iOS,v1.0
Any help would be highly appreciated. Thanks!!!

Related

Warnings when installing R package with Rcpp

I am tring to build an R package with Rcpp using Rstudio. When I click "install and restart", Rstudio outputs hundreds of warning information and I cannot easily find the error information. I tried to find out reason to avoid the warning information but failed. It seems the warnings are from Rcpp package. BTW, the package can still work.
The below is the additional options for R CMD INSTALL
--no-multiarch --with-keep.source
The information can be replicated using the below commands
library(devtools) # author version: 2.3.0, use install.packages("devtools") first
install_github("GeneticAnalysisinBiobanks/GRAB", INSTALL_opts=c("--no-multiarch")) # The INSTALL_opts is required in Windows OS.
My working environment:
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_2.4.2 usethis_2.0.1
loaded via a namespace (and not attached):
[1] rstudioapi_0.13 magrittr_2.0.1 pkgload_1.2.1 R6_2.5.0
[5] rlang_0.4.11 fastmap_1.1.0 tools_4.1.0 pkgbuild_1.2.0
[9] sessioninfo_1.1.1 cli_3.0.0 withr_2.4.2 ellipsis_0.3.2
[13] remotes_2.4.0 rprojroot_2.0.2 lifecycle_1.0.0 crayon_1.4.1
[17] processx_3.5.2 purrr_0.3.4 callr_3.7.0 fs_1.5.0
[21] ps_1.6.0 curl_4.3.1 testthat_3.0.4 memoise_2.0.0
[25] glue_1.4.2 cachem_1.0.5 compiler_4.1.0 desc_1.3.0
[29] prettyunits_1.1.1
The below include the warning information when I install and restart the package.
In file included from C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/RcppCommon.h:118,
from C:/Users/wenjianb/Documents/R/win-library/4.1/RcppArmadillo/include/RcppArmadilloForward.h:26,
from C:/Users/wenjianb/Documents/R/win-library/4.1/RcppArmadillo/include/RcppArmadillo.h:31,
from RcppExports.cpp:4:
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'const char* Rcpp::type2name(SEXP)':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'const char* (*)(SEXPREC*)'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:74:26: note: in expansion of macro 'GET_CALLABLE'
static Fun fun = GET_CALLABLE("type2name");
^~~~~~~~~~~~
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'long unsigned int Rcpp::internal::enterRNGScope()':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'long unsigned int (*)()'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:81:30: note: in expansion of macro 'GET_CALLABLE'
static Fun fun = GET_CALLABLE("enterRNGScope");
^~~~~~~~~~~~
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'long unsigned int Rcpp::internal::exitRNGScope()':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'long unsigned int (*)()'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:87:30: note: in expansion of macro 'GET_CALLABLE'
static Fun fun = GET_CALLABLE("exitRNGScope");
^~~~~~~~~~~~
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'long unsigned int Rcpp::internal::beginSuspendRNGSynchronization()':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'long unsigned int (*)()'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
The other warnings are all similar to the above.
Thank you all in advance.
Wenjian

Cannot compile example code in libpca

I'm trying to install the libpca package.
I've already have Armadillo set up.
The libpca package is unzipped to /my/dir/. And I set the CPLUS_INCLUDE_PATH and other variables to the place Armadillo installed. (export CPLUS_INCLUDE_PATH=/my/dir/arma_install/include/:$CPLUS_INCLUDE_PATH)
I run the following command to install libpca:
/my/dir/libpca-1.3.3$ ./configure --prefix=/my/dir/libpca-1.3.3
/my/dir/libpca-1.3.3$ make
which has warnings but no error. And the command:
/my/dir/libpca-1.3.3$ make install prefix=/my/dir/libpca-1.3.3
It seems good and no error is reported.
Then I try to compile and run the example file in /my/dir/libpca-1.3.3/examples/simple/pca_example.cpp. In dir examples, I run
/my/dir/libpca-1.3.3/examples$ make
It returns
make[1]: Nothing to be done for 'all'
make[1]: Nothing to be done for 'all-am'
And no new file is created. Then I cd into examples/simple, and run
/my/dir/libpca-1.3.3/examples/simple$ make
It returns:
make: Nothing to be done for 'all'
And no new file is created. Then I run
/my/dir/libpca-1.3.3/examples/simple$ make check
It returns the following errors:
The variables wrapper_dsyev_, wrapper_dgemv_, wrapper_dgemm_, etc. in the errors above, exist in the following binaries:
/my/dir/arma_install/lib64/libarmadillo.so.8.500.0
/my/dir/arma_downloaded/CMakeFiles/armadillo.dir/src/wrapper.cpp.o
/my/dir/arma_downloaded/CMakeFiles/CMakeRelink.dir/libarmadillo.so.8.500.0
After I export them into LD_LIBRARY_PATH, the same errors are still returned.
I think there should be something wrong with the include path, and environment variables. How do I solve it?
Moreover, if I need to write code in /my/dir/working_dir/, how can I set the path?
----------------------------------edited below--------------------
When I made the update described below, at step 3:
/my/dir/libpca-1.3.3$ LD_LIBRARY_PATH=/my/dir/arma_install/lib64 make check
It returns the following errors:
LD_LIBRARY_PATH=/my/dir/arma_install/lib64/ make check
Making check in src/lib
make[1]: Entering directory `/my/dir/libpca-1.3.3/src/lib'
make[1]: Leaving directory `/my/dir/libpca-1.3.3/src/lib'
Making check in test
make[1]: Entering directory `/my/dir/libpca-1.3.3/test'
make unittest
make[2]: Entering directory `/my/dir/libpca-1.3.3/test'
/bin/sh ../libtool --tag=CXX --mode=link g++ -I../src/lib
-pthread -O2 -o unittest main.o testcases.o test_pca.o test_utils.o ../src/lib/.libs/libpca.a -L/my/dir/source_scripts/lib64
libtool: link: g++ -I../src/lib -pthread -O2 -o unittest main.o
testcases.o test_pca.o test_utils.o ../src/lib/.libs/libpca.a
-L/my/dir/arma_install/lib64 -pthread
test_utils.o: In function `void arma::glue_times::apply, arma::Mat
(arma::Mat&, arma::Mat const&, arma::Mat const&, double)':
test_utils.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb1ELb0ELb1ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb1ELb0ELb1ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x169):
undefined reference to `wrapper_dgemm_'
test_utils.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb1ELb0ELb1ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb1ELb0ELb1ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x363):
undefined reference to `wrapper_dgemv_'
test_utils.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb1ELb0ELb1ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb1ELb0ELb1ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x45c):
undefined reference to `wrapper_dsyrk_'
../src/lib/.libs/libpca.a(pca.o): In function
`stats::pca::bootstrap_eigenvalues_()':
pca.cpp:(.text+0x454d): undefined reference to `wrapper_dsyev_'
pca.cpp:(.text+0x4953): undefined reference to `wrapper_dsyevd_'
../src/lib/.libs/libpca.a(pca.o): In function `bool
arma::auxlib::eig_sym_dc
(arma::Col&, arma::Mat&, arma::Base > const&)':
pca.cpp:(.text._ZN4arma6auxlib10eig_sym_dcIdNS_3MatIdEEEEbRNS_3ColIT_EERNS2_IS5_EERKNS_4BaseIS5_T0_EE[_ZN4arma6auxlib10eig_sym_dcIdNS_3MatIdEEEEbRNS_3ColIT_EERNS2_IS5_EERKNS_4BaseIS5_T0_EE]+0x13a):
undefined reference to `wrapper_dsyevd_'
../src/lib/.libs/libpca.a(pca.o): In function `bool
arma::eig_sym
(arma::Col::pod_type>&, arma::Mat::elem_type>&,
arma::Base::elem_type, arma::Mat > const&,
char const*,
arma::arma_blas_type_only::elem_type>::result
const*)':
pca.cpp:(.text._ZN4arma7eig_symINS_3MatIdEEEEbRNS_3ColINT_8pod_typeEEERNS1_INS4_9elem_typeEEERKNS_4BaseIS8_S4_EEPKcPKNS_19arma_blas_type_onlyIS8_E6resultE[_ZN4arma7eig_symINS_3MatIdEEEEbRNS_3ColINT_8pod_typeEEERNS1_INS4_9elem_typeEEERKNS_4BaseIS8_S4_EEPKcPKNS_19arma_blas_type_onlyIS8_E6resultE]+0x1a0):
undefined reference to `wrapper_dsyev_'
../src/lib/.libs/libpca.a(pca.o): In function `double
arma::auxlib::det_lapack(arma::Mat const&, bool)':
pca.cpp:(.text._ZN4arma6auxlib10det_lapackIdEET_RKNS_3MatIS2_EEb[_ZN4arma6auxlib10det_lapackIdEET_RKNS_3MatIS2_EEb]+0x117):
undefined reference to `wrapper_dgetrf_'
../src/lib/.libs/libpca.a(pca.o): In function `void arma::gemv::apply_blas_type >(double*,
arma::Mat const&, double const*, double, double)':
pca.cpp:(.text._ZN4arma4gemvILb1ELb0ELb0EE15apply_blas_typeIdNS_3MatIdEEEEvPT_RKT0_PKS5_S5_S5_[_ZN4arma4gemvILb1ELb0ELb0EE15apply_blas_typeIdNS_3MatIdEEEEvPT_RKT0_PKS5_S5_S5_]+0x86):
undefined reference to `wrapper_dgemv_'
../src/lib/.libs/libpca.a(pca.o): In function `void arma::gemv::apply_blas_type >(double*,
arma::Mat const&, double const*, double, double)':
pca.cpp:(.text._ZN4arma4gemvILb0ELb0ELb0EE15apply_blas_typeIdNS_3MatIdEEEEvPT_RKT0_PKS5_S5_S5_[_ZN4arma4gemvILb0ELb0ELb0EE15apply_blas_typeIdNS_3MatIdEEEEvPT_RKT0_PKS5_S5_S5_]+0x86):
undefined reference to `wrapper_dgemv_'
../src/lib/.libs/libpca.a(pca.o): In function `void
arma::glue_times::apply, arma::Mat >(arma::Mat&,
arma::Mat const&, arma::Mat const&, double)':
pca.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb0ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb0ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x129):
undefined reference to `wrapper_dgemm_'
pca.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb0ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb0ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x334):
undefined reference to `wrapper_dgemv_'
../src/lib/.libs/libpca.a(pca.o): In function `void
arma::glue_times::apply,
arma::Mat >(arma::Mat&, arma::Mat const&,
arma::Mat const&, double)':
pca.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb0ELb1ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb0ELb1ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x14a):
undefined reference to `wrapper_dgemm_'
pca.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb0ELb1ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb0ELb1ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x33c):
undefined reference to `wrapper_dsyrk_'
../src/lib/.libs/libpca.a(utils.o): In function
`stats::utils::compute_column_rms(arma::Mat const&)':
utils.cpp:(.text+0xe95): undefined reference to `wrapper_ddot_'
../src/lib/.libs/libpca.a(utils.o): In function `void
arma::glue_times::apply,
arma::Mat >(arma::Mat&, arma::Mat const&,
arma::Mat const&, double)':
utils.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb1ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb1ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x353):
undefined reference to `wrapper_dgemm_'
utils.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb1ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb1ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x8a4):
undefined reference to `wrapper_dgemv_'
utils.cpp:(.text.hot._ZN4arma10glue_times5applyIdLb1ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_[_ZN4arma10glue_times5applyIdLb1ELb0ELb0ENS_3MatIdEES3_EEvRNS2_IT_EERKT3_RKT4_S4_]+0x9ab):
undefined reference to `wrapper_dsyrk_'
collect2: error: ld returned 1 exit status
make[2]: *** [unittest] Error 1
make[2]: Leaving directory `/my/dir/libpca-1.3.3/test'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/my/dir/libpca-1.3.3/test'
make: *** [check-recursive] Error 1
What should I do next?
You need to tell the linker of the location of your armadillo library. You can achieve this in two ways:
Through environment variable: export LIBRARY_PATH=/arma/lib:$LIBRARY_PATH
Passing armadillo include and library path to configure directly:
./configure --with-armadillo-incdir=/arma/include --with-armadillo-libdir=/arma/lib
I would recommend using option 2 as it prevents settings up extra environment variables which may pollute, well, your environment.
Note that --prefix denotes the directory in which libpca is being installed to. This should be different from the source directory!
After configure you can run make, make check, and make install. For make check to succeed the linux library loader needs to know the location of the armadillo shared library. So one option is to run like so: LD_LIBRARY_PATH=/arma/lib make check
To summarize the commands you need to run:
./configure --prefix=/libpca/install --with-armadillo-incdir=/arma/include --with-armadillo-libdir=/arma/lib
make
LD_LIBRARY_PATH=/arma/lib make check
make install
Obviously, you need to adjust the paths to your situation.
Caveat: On some platforms you need to explicitly link with lapack and blas. So if you run into further linker errors then try configuring like this:
LIBS='-llapack -lblas' ./configure --prefix=/libpca/install --with-armadillo-incdir=/arma/include --with-armadillo-libdir=/arma/lib

error: 'SetPosition' was not declared in this scope

Arduino: 1.6.9 (Windows 10), Board: "Arduino Mega ADK"
In file included from C:\Users\Disheet\Downloads\humanoid_1\humanoid_1.ino:1:0:
C:\Users\Disheet\Documents\Arduino\libraries\ax12v2/ax12.h:66:23: error: conflicting declaration 'typedef unsigned char boolean'
typedef unsigned char boolean;
^
In file included from sketch\humanoid_1.ino.cpp:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:117:14: error: 'boolean' has a previous declaration as 'typedef bool boolean'
typedef bool boolean;
^
C:\Users\Disheet\Downloads\humanoid_1\humanoid_1.ino: In function 'void setup()':
humanoid_1:5: error: 'SetPosition' was not declared in this scope
SetPosition(1,0);////id,posiotin 0-1023
^
C:\Users\Disheet\Downloads\humanoid_1\humanoid_1.ino: In function 'void loop()':
humanoid_1:13: error: 'SetPosition' was not declared in this scope
SetPosition(1,512);
^
Multiple libraries were found for "ax12.h"
Used: C:\Users\Disheet\Documents\Arduino\libraries\ax12v2
Not used: C:\Users\Disheet\Documents\Arduino\libraries\Bioloid
exit status 1
'SetPosition' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
You'll need to find typedef unsigned char boolean; in your library and change it to match the version in Arduino.h.
boolean is already a typedef in Arduino.h, and it is a bool ,not unsigned char.
In the AX12 library search for this:
https://github.com/7Robot/Arduino/blob/master/AX12/libraries/ax12/ax12.h#L66
And change it to typedef bool boolean;.
This was updated a while ago, so your IDE version is newer than the AX12 library.

wxc-0.91.0.0 failed to install

I'm trying to install reactive-banana, wx, wxcore in cabal sandbox. When cabal install --only-dependencies is run following error message is given:
src\cpp\eljlistctrl.cpp: In function 'int ListCmp(long int, long int, long int)':
src\cpp\eljlistctrl.cpp:16:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
src\cpp\eljlistctrl.cpp:16:53: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
src\cpp\eljlistctrl.cpp: In function 'bool wxListCtrl_SortItems(wxListCtrl*, void*, void*)':
src\cpp\eljlistctrl.cpp:478:41: error: cast from 'EiffelSort* {aka _EiffelSort*}' to 'long int' loses precision [-fpermissive]
src\cpp\eljlistctrl.cpp:478:44: error: invalid conversion from 'int (*)(long int, long int, long int)' to 'wxListCtrlCompare {aka int (*)(long long int, long long int, long long int)}' [-fpermissive]
C:\wxWidgets-3.0.2\include/wx/msw/listctrl.h:342:10: error: initializing argument 1 of 'bool wxListCtrl::SortItems(wxListCtrlCompare, wxIntPtr)' [-fpermissive]
What is wrong and how to solve this?
The code in this file just seems to be wrong and uses 32 bit types even in what looks like 64 bit build. Unless it was fixed in later versions, the only solution would be to build it in 32 bits, i.e. use a 32 bit Haskell installation.

Mistake when compiling under Linux a CUDA code originally developed under Windows

The code was developed from Windows system, when I compile my CUDA code in Linux system by command:
nvcc lbm.cu -I/usr/local/cuda_sdk/CUDALibraries/common/inc -lm
Compiler output is:
In file included from lbm.cu:15:
lbm_kernel.h:52:8: warning: extra tokens at end of #endif directive
In file included from lbm.cu:15:
lbm_kernel.h:52:8: warning: extra tokens at end of #endif directive
/tmp/tmpxft_00001fda_00000000-13_lbm.o: In function "main":
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0xce7): undefined reference to "cutCheckCmdLineFlag"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x2103): undefined reference to "diff_wz_w(dim3, int, double*, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x2143): undefined reference to "double gpu_sum<double>(int, int, int, int, int, double*, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x21ca): undefined reference to "fabs_wz(dim3, int, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x220a): undefined reference to "double gpu_sum<double>(int, int, int, int, int, double*, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x22a3): undefined reference to "cpy(dim3, int, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x2320): undefined reference to "lbm_step(dim3, int, int, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x23b5): undefined reference to "lbm_bounce_back_exit_inlet(dim3, int, int, float, float, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x248f): undefined reference to "lbm_bounce_back_hole_wall_1(dim3, int, int, float, float, int, int, int, int, int, int, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x2501): undefined reference to "lbm_bounce_back_wall_2(dim3, int, int, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x25a2): undefined reference to "lbm_stream(dim3, int, int, double*, double*)"
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text+0x2643): undefined reference to "lbm_den_vel(dim3, int, int, double*, double*, double*, double*, double*)"
/tmp/tmpxft_00001fda_00000000-13_lbm.o: In function "__cutilExit(int, char**)":
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text._Z11__cutilExitiPPc[__cutilExit(int, char**)]+0x21): undefined reference to "cutCheckCmdLineFlag"
/tmp/tmpxft_00001fda_00000000-13_lbm.o: In function "cutilDeviceInit(int, char**)':
tmpxft_00001fda_00000000-1_lbm.cudafe1.cpp:(.text._Z15cutilDeviceInitiPPc[cutilDeviceInit(int, char**)]+0x8b): undefined reference to "cutGetCmdLineArgumenti"
collect2: ld returned 1 exit status
What can I do for my code?
You'll need to include the library that contains the functions that are still listed as "undefined reference:
cutCheckCmdLineFlag
cutGetCmdLineArgument
These functions can probably be added to your link process using a modification of your compile command line to something like this:
nvcc lbm.cu -I/usr/local/cuda_sdk/CUDALibraries/common/inc -L/usr/local/cuda_sdk/shared/lib -lshrutil -lcutil -lm
Anyway, you want to find the libraries libshrutil.a or libshrutil_x86_64.a and libcutil.a or libcutil_x86_64.a and you want to link them into your program by specifying the path to these libraries using the -L switch and specifying the library name (minus the lib in the beginning and the .a at the end) using the -l switch.

Resources