Compiling given CGAL example on polyfit - cgal

i have linked the gmplib to the following example https://doc.cgal.org/5.0.4/Polygonal_surface_reconstruction/index.html
on windows and visual studio
but i got the error
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __gmpn_neg_n referenced in function "private: static struct CGAL::Mpzf __cdecl CGAL::Mpzf::aors(struct CGAL::Mpzf const &,struct CGAL::Mpzf const &,int)" (?aors#Mpzf#CGAL##CA?AU12#AEBU12#0H#Z) cgal-polyfit

Related

Undefined symbol: _swift_getOpaqueTypeConformance - React Native & SwiftUI

I'm trying to port a SwiftUI view into react native following this guide. It build fine in swift project but not in a react native project.
I'm getting the following error:
Undefined symbols for architecture x86_64:
"_swift_getOpaqueTypeConformance", referenced from:
lava.ColorWheelView.body.getter : some in ColorWheelView.o
closure #2 (SwiftUI.GeometryProxy) -> <<opaque return type of lava.ColorWheelView.makeView(SwiftUI.GeometryProxy) -> some>>.0 in lava.ColorWheelView.body.getter : some in ColorWheelView.o
associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.ColorWheelView : SwiftUI.View in lava in ColorWheelView.o
l_get_witness_table qd0__7SwiftUI4ViewHD3_AaBPAAE7gesture_9includingQrqd___AA11GestureMaskVtAA0F0Rd__lFQOyAA15ModifiedContentVyAA6ZStackVyAA05TupleC0VyAJyAA06_ShapeC0VyAA9RectangleVAA5ColorVGAA12_FrameLayoutVG_AJy4lava010GuitarPickC0VAA13_OffsetEffectVGtGGAA09_PositionP0VG_AA06_EndedF0VyAA0f5StateF0VyAA08_ChangedF0VyAA04DragF0VGSo7CGPointVSgGGQo_HO in ColorWheelView.o
associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.TrianglePath : SwiftUI.View in lava in GuitarPickView.o
associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.GuitarPickView : SwiftUI.View in lava in GuitarPickView.o
"_swift_getTypeByMangledNameInContextInMetadataState", referenced from:
___swift_instantiateConcreteTypeFromMangledNameAbstract in ColorWheelView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To reproduce I made this Github repo
Copy those files in a react native project and try to build. Make sure to replace the header file import with your test project name "<Replace This>-Swift.h"
My build target is iOS 13.5 iPhone 11 Pro Max simulator.

CUDA Separable Compilation with CMake, invalid device function

I am developing a C++ application with cmake as the build system. Each component in the application builds into a static library, which the executable links to.
I am trying to link in some cuda code that is built as a separate static library, also with cmake. When I attempt to invoke the global function entry point in the cuda static library from the main application, everything seems to work fine - the cudaDeviceSynchronize that follows my global function invocation returns 0. However, the output of the kernel is not set and the call returns immediately.
I ran cuda-gdb. Despite the code being compiled with -g and -G, I was not able to break within the device function called by the kernel. So, I ran cuda-memcheck. When the kernel is launched, this message appears:
========= Program hit cudaErrorInvalidDeviceFunction (error 8) due to "invalid device function" on CUDA API call to cudaLaunchKernel.
I looked this up, and the NVIDIA docs/forum posts I read suggested this is usually due to compiling for the wrong compute capability. However, I'm running Titan V's, and the CC is correctly set to 7.0 when compiling.
I have set CUDA_SEPARABLE_COMPILATION on both the cuda library and the component in the main application that the cuda code links to per https://devblogs.nvidia.com/building-cuda-applications-cmake/. I've also tried setting CUDA_RESOLVE_DEVICE_SYMBOLS.
Here is the relevant portion of the cmake for the main application:
(kronmult_cuda is the component in the main application that links to the cuda library ${KRONLIB}. another component, kronmult, links to kronmult_cuda. Eventually, something that links to kronmult is linked to the main application).
find_package(CUDA 9.0 REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
enable_language(CUDA)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch sm_70 -g --ptxas-options=-O3")
set_source_files_properties( src/kronmult_cuda.cpp PROPERTIES LANGUAGE CUDA ) # no .cu extension
...
target_include_directories(kronmult_cuda PRIVATE ${KRON_PATH})
target_link_libraries(kronmult_cuda PRIVATE OpenMP::OpenMP_CXX PUBLIC ${KRON_LIB})
if (ASGARD_USE_CUDA)
set_target_properties(kronmult_cuda
PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
endif()
if(APPLE AND ASGARD_USE_GPU)
set_target_properties(kronmult_cuda
PROPERTIES
BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif ()
target_link_libraries(kronmult PRIVATE kronmult_cuda)
...
Full CMakeLists: https://github.com/bmcdanie/ASGarD/blob/feature/kronmult/CMakeLists.txt.
relevant CMakeLists portion for cuda library:
project(kronmult LANGUAGES CXX CUDA)
set(KRONSRC
[list of all sources]
)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch sm_70 -g --ptxas-options=-O3")
set_source_files_properties( ${KRONSRC} PROPERTIES LANGUAGE CUDA )
add_library(kron STATIC ${KRONSRC})
target_compile_features(kron PUBLIC cxx_std_11)
set_target_properties( kron
PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
Full CmakeLists: https://github.com/project-asgard/kronmult/blob/master/CMakeLists.txt.
What am I missing here?
EDIT:
Output of cuda-gdb when I attempt to call kernel:
Thread 1 "asgard" hit Breakpoint 1, kronmult2_xbatched<double> (n=2, Aarray_=0x15551fa24800, lda=8, pX_=0x15551fa23c00, pY_=0x15551fa24400, pW_=0x15551fa24000, batchCount=128)
at /home/3bm/asgard/contrib/kronmult/src/kronmult-ext/kronmult2_xbatched.hpp:36
36 {
(cuda-gdb) step
__wrapper__device_stub_kronmult2_xbatched<double> (__cuda_0=#0x7fffffff9e1c: 2, __cuda_1=0x15551fa24800, __cuda_2=#0x7fffffff9e18: 8, __cuda_3=0x15551fa23c00,
__cuda_4=0x15551fa24400, __cuda_5=0x15551fa24000, __cuda_6=#0x7fffffff9e30: 128) at /tmp/tmpxft_0000ac33_00000000-5_kronmult_cuda.cudafe1.stub.c:40
40 /tmp/tmpxft_0000ac33_00000000-5_kronmult_cuda.cudafe1.stub.c: No such file or directory.
(cuda-gdb) step
__device_stub__Z18kronmult2_xbatchedIdEviPKPKT_iPPS0_S6_S6_i (__par0=2, __par1=0x15551fa24800, __par2=8, __par3=0x15551fa23c00, __par4=0x15551fa24400, __par5=0x15551fa24000,
__par6=128) at /tmp/tmpxft_0000ac33_00000000-5_kronmult_cuda.cudafe1.stub.c:39
39 in /tmp/tmpxft_0000ac33_00000000-5_kronmult_cuda.cudafe1.stub.c
(cuda-gdb) step
dim3::dim3 (this=0x7fffffff9d28, vx=1, vy=1, vz=1)
at /home/dg6/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/cuda-10.0.130-s6ervywpchxmerrju62il7xkeeamlfcv/include/vector_types.h:420
420 __host__ __device__ dim3(unsigned int vx = 1, unsigned int vy = 1, unsigned int vz = 1) : x(vx), y(vy), z(vz) {}
(cuda-gdb) step
dim3::dim3 (this=0x7fffffff9d34, vx=1, vy=1, vz=1)
at /home/dg6/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/cuda-10.0.130-s6ervywpchxmerrju62il7xkeeamlfcv/include/vector_types.h:420
420 __host__ __device__ dim3(unsigned int vx = 1, unsigned int vy = 1, unsigned int vz = 1) : x(vx), y(vy), z(vz) {}
(cuda-gdb) step
cudaLaunchKernel<char> (
func=0x5555555f94c0 <kronmult2_xbatched<double>(int, double const* const*, int, double**, double**, double**, int)> "UH\211\345H\203\354\060\211}\374H\211u\360\211U\370H\211M\350L\211E\340L\211M\330L\213E\330H\213}\340H\213M\350H\215U\370H\213u\360H\215E\374H\203\354\bL\215M\020AQM\211\301I\211\370H\211\307\350\355\343\377\377H\203\304\020\220\311\303UH\211\345H\203\354\060\211}\374H\211u\360\211U\370H\211M\350L\211E\340L\211M\330L\213E\330H\213}\340H\213M\350H\215U\370H\213u\360H\215E\374H\203\354\bL\215M\020AQM\211\301I\211\370H\211\307\350\267\345\377\377H\203\304\020\220\311\303UH\211\345H\203\354\060\211}\374H\211u\360\211U\370H\211M\350L\211E\340L\211", <incomplete sequence \330>..., gridDim=..., blockDim=...,
args=0x7fffffff9d40, sharedMem=0, stream=0x0)
at /home/dg6/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/cuda-10.0.130-s6ervywpchxmerrju62il7xkeeamlfcv/bin/..//include/cuda_runtime.h:202
202 return ::cudaLaunchKernel((const void *)func, gridDim, blockDim, args, sharedMem, stream);
(cuda-gdb) step
warning: Cuda API error detected: cudaLaunchKernel returned (0x8)
After the helpful hint from #talonmies, I suspected this was a device linking problem. I simplified my build process, included all CUDA files in one translation unit, and turned off SEPARABLE COMPILATION.
Still, I did not see a cmake_device_link.o in either my main application binary or the component that called into my cuda library. And, still had the same error. Tried setting CUDA_RESOLVE_DEVICE_SYMBOLS to no effect.
Finally, I tried building the component that calls into my cuda library as SHARED. I saw the device linking step when building the .so in my cmake output, and the program runs fine. I do not know why building SHARED fixes what I suspect was a device linking problem - will accept any answer that deciphers that?

Vega-Embed giving build error Cannot find name 'Extract' and 'Exclude'

I created angular 6 application(Using node). In this application I used vega-embed. It is giving me compilation error.
import embed from 'vega-embed';
I also changed code in util.d.ts import stableStringify = require('json-stable-stringify') but giving following error
ERROR in node_modules/vega-lite/build/src/util.d.ts(58,41): error TS2304: Cannot find name 'Extract'.
node_modules/vega-lite/build/src/util.d.ts(73,58): error TS2304: Cannot find name 'Exclude'.
Please suggest.

XCODE 8 xcuitest code generation compilation error

I have downloaded the xcode 8, and tried to record a test in xcuitest
but the generated code by xcode gives compilation error
Generated code
window.tables.children(matching: .tableRow).element(boundBy: 0).children(matching: .cell).element(boundBy: 5).click()
Error
but it is giving compilation error like Value of type
'XCUIElementQuery' has no member ‘containing’
'XCUIElementQuery' has no member ‘ children’
'XCUIElementQuery' has no member ‘ matching’
'XCUIElementQuery' has no member ‘ element'
also .other should be changed to .Other
.cell should be changed to .Cell to fix the error
i selected swift 2.3 while installing xcode 8
Any help appreciated
It looks like the code generator migrated to a new sytnax for the call to the children, but not the code interpreter. Replace .children(matching: .cell) with childrenMatchingType(.Cell)

connected to the project at Ada QT libraries

When connecting to a project on Ada QT library produces errors.
with QT; use QT;
.....
Log.
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x14): undefined reference to QChar1_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x30): undefined reference toQChar2_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x5a): undefined reference to QChar3_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x6f): undefined reference toQChar4_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x8b): undefined reference to QChar5_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xa7): undefined reference toQChar6_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xbb): undefined reference to QChar7_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xcf): undefined reference toQChar8_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xe3): undefined reference to QChar_latin1'
e:/gnat/2013/bin/../libexec/gcc/i686-pc-mingw32/4.7.4/ld.exe: E:\GNAT\2013\qtada\qt-qchar.o: bad reloc address 0x20 in section.eh_frame'
e:/gnat/2013/bin/../libexec/gcc/i686-pc-mingw32/4.7.4/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
gprbuild: link of main.adb failed
[2014-04-28 08:15:40] process exited with status 4 (elapsed time: 01.50s)
Are your installed QT,QTADA libraries compatible with the Mingw-Toolchain? Also regarding the bitness 32/64. The Versions of your libraries and the compile/linker command would be helpful.
You might also consider following hint:
GMP with MinGW on Windows