'itkSingleValuedCostFunction.h': No such file or directory - itk

I am trying to calculate the mutual information between two images, for that purpose I am using the class ‘MutualInformationImageToImageMetric’. After reading this example : http://www.itk.org/Wiki/ITK/Examples/Registration/MutualInformation I am using the following new four ‘#include’ lines in my code:
#include "itkImageRegistrationMethod.h"
#include "itkTranslationTransform.h"
#include "itkMutualInformationImageToImageMetric.h"
#include "itkLinearInterpolateImageFunction.h"
After that I received a fatal error telling me that : 'itkSingleValuedCostFunction.h': No such file or directory
I have use quite a lot of other classes of itk and it works always…what is happening now? Any hints please?
Thanks !
Antonio Gómez Barquero

I'm using the GIT version of ITK and updated my CMakeList.txt to
cmake_minimum_required(VERSION 2.8)
PROJECT(MutualInformation)
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
ADD_EXECUTABLE(MutualInformation MutualInformation.cxx)
TARGET_LINK_LIBRARIES(MutualInformation ${ITK_LIBRARIES})
Everything went fine.
Which ITK have you built?
I do not have ITK 3.20 built right now. Does itkSingleValuedCostFunction.h exist under Code\Numerics ? Is you makefile properly set to TARGET_LINK_LIBRARIES(MutualInformation ITKIO ITKNumerics) ?
Or, if you use ITK git, do you see the file under Modules\Numerics\Optimizers\include ?
Note that you could post questions related to ITK on the ITK mailing list. Register at http://www.itk.org/mailman/listinfo/insight-users

Related

Fatal error (13): No program entry point with XDS Modula-2?

I'm using the current bundled binaries from https://github.com/excelsior-oss/xds (as of 12/6/2020) with just the most basic Hello World MOD file:
MODULE HelloWorld;
FROM STextIO IMPORT WriteLn, WriteString;
BEGIN
WriteString("Hello, World!");
WriteLn;
END HelloWorld.
xc HelloWorld.mod works fine for compiling it to object. However, I'm not clear on the exact syntax for xlink on a standalone MOD file. xlink HelloWorld.obj will at least get it to try with my object file, but as the error shows, it doesn't know the entrypoint. I've tried setting the entry point with the /ENTRY switch, but no luck doing it by module name. I've also tried setting the /SYS to console, but again, no luck there.
I feel there's some trivial linker option or program directive needed, but I'm just not finding it via Google...
To build a binary, use: xc =a =make HelloWorld.mod
The above is found in https://github.com/excelsior-oss/xds/blob/master/Sources/Doc/Comp/src/usage.tex .
It is unfortunate that XDS did not put PDFs of their documentation on github. I suggest building the documentation from their LaTeX files.
Edit: I since learnt that the Wayback Machine has archived the XDS documentation here: https://web.archive.org/web/20060705213825/http://www.excelsior-usa.com/xdsdoc.html

Linker error with mysql.h in c programming

Hi I would like to solve how I can fix with linker error.
What I wanted to do is to include header file which is mysql.h from /usr/local/include.(I'm using mac book)
But when compiling the header file which is below, compiler says "Undefined symbols for architecture"
#include </usr/local/include/mysql.h>
I obviously installed mysql and connecter-c.
Please teach me how to fix it and why mysql.h is not included.
Best regards,
please check the format in which you have included the header file.
#include </usr/local/include/mysql.h>
should be
#include "/usr/local/include/mysql.h"
the "<>" is used to include system header files. please use double quotes ("") to include user header files.

How to link cusparse using CMakeLists.txt

How can I add the cusparse library from CUDA in a CMakeLists.txt-file, such that the nvcc compiler includes it automatically with -lcusparse? I already added the line
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-lcusparse)
in CMakeLists.txt with no success. It looks like I'm missing something, because Nsight throws the error
undefined reference to 'cusparseDestroyMatDescr'.
Although when I exclude this line where cusparseDestroyMatDescr is called via commenting it, the Nsight project builds with no error, even with these three lines of code included
cusparseStatus_t status;
cusparseHandle_t handle=0;
cusparseMatDescr_t descr=0;
So it looks like it knows what cusparseStatus_t and so on is, but it does not know what cusparseDestroyMatDescr is.
What do I miss?
The correct way in CMake to link a library is using
target_link_libraries( target library ).
If you use FindCUDA to locate the CUDA installation, the variable CUDA_cusparse_LIBRARY will be defined. Thus, all you need to do is
target_link_libraries( target ${CUDA_cusparse_LIBRARY} )
I recommend to use the CMake CUDAToolkit package, which is available with CMake 3.17 and newer:
find_package(CUDAToolkit REQUIRED)
...
target_link_libraries(target CUDA::cusparse)

Mediatek Linkit One Error when compiling in Arduino IDE 1.6.6: arm-none-eabi-g++: no such file or directory

So, as you can see in the title, I am having a problem with my Linkit One. I am using Arduino IDE 1.6.6, and I am using the Linkit One SDK 1.1.17 through the Arduino board's manager. When I compile anything, even a simple bare minimum Arduino program, I get this error:
arm-none-eabi-g++: error: ~My System Path\Temp\build3694385943597424511.tmp/syscalls_mtk.c.o: No such file or directory Error compiling.
I have searched long and hard for an answer to this problem, and I have found nothing. Please inform me if I need to provide extra information.
Thanks, Fiske
I got it to work by editing platform.txt
and adding core/ so that it reads:
{build.path}/core/syscalls_mtk.c.o
instead of
{build.path}/syscalls_mtk.c.o
platform.txt was located in:
/Users/awootton/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.17
Okay: Here is what I did. First of all, I switched to IDE 1.6.5, like you said. Then I followed the tutorial here: https://www.hackster.io/seeyouu/smart-city-bus-network-9f4cb0. FINALLY I got the linkit to work. You have no idea how long that took.
Try v1.6.5 of the ide. Seemed to fix the issue for us!

Linking issue CUDA 5.5 nsight

I am trying to compile a CUDA 5.5 application on nsight with ubuntu 12.04
At first I was getting an issue about missing header files such as #include <helper_cuda_drvapi.h>
To fix this I added the path /usr/include/samples/common/inc to my includes list.
This solved the missing header file issue but caused a new issue.
when trying to compile the program on nsight I get the following errors
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:278: undefined reference to cuInit'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:279: undefined reference tocuDeviceGetCount'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:290: undefined reference to cuDeviceGetName'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:291: undefined reference tocuDeviceComputeCapability'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:294: undefined reference to cuDeviceGetAttribute'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:327: undefined reference tocuDeviceGetAttribute'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:330: undefined reference to cuDeviceGetAttribute'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:333: undefined reference tocuDeviceComputeCapability'
/usr/local/cuda-5.5/samples/common/inc/helper_cuda_drvapi.h:336: undefined reference to `cuDeviceGetAttribute'
any suggestions?
Thanks in advance
*****************UPDATE************
What it basically comes down to is I am trying to compile the "CUDA Video Decoder GL API" sample program on linux and it is not working because of some error with the header files. Does anyone know why this is?
UPDATE
The undefined references are to CUDA driver API methods. helper_cuda_drvapi.h has the following comment near the top:
Helper functions for CUDA Driver API error handling (make sure that CUDA_H is included in your projects)
So, in your .cu and .cpp files, before the #include <helper_cuda_drvapi.h>, include cuda.h:
#include "cuda.h"
#include <helper_cuda_drvapi.h>
See this question for more information about the CUDA headers.
You need to manually link with libcuda (Nsight projects use Runtime API)
To link with this library:
Go to Properties for your project, open General / Path and Symbols
On the Libraries tab add cuda (without prefix or suffix - in theory should make your project more clossplatform. You may also want to check "Add to all configurations" when adding the library - otherwise it will be for your current build configuration (e.g. "Debug" or "Release" only).
Update: Project settings screenshot: