Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

julia using cxxwrap, realese is working but it is not possible to Debug #435

Open
pablodecastillo opened this issue May 31, 2024 · 4 comments

Comments

@pablodecastillo
Copy link

Hello,
julia using cxxwrap, realese is working but it is not possible to Debug, giving this error, attached pic

Captura desde 2024-05-31 19-20-35

@barche
Copy link
Collaborator

barche commented May 31, 2024

Based on the screenshot I have no idea, can you give some more details on what you are trying to do and how to reproduce this?

@pablodecastillo
Copy link
Author

I am working in a long code, before to update it was possible to debug, because i could not debug, i build a helloworld sample, and i am getting the same problem.
here the files:
CMakelist.txt:
project(HelloWorld)

cmake_minimum_required(VERSION 3.5)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

find_package(JlCxx)
get_target_property(JlCxx_location JlCxx::cxxwrap_julia LOCATION)
get_filename_component(JlCxx_location ${JlCxx_location} DIRECTORY)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${JlCxx_location}")

message(STATUS "Found JlCxx at ${JlCxx_location}")

add_library(hello SHARED hello.cpp)

target_link_libraries(hello JlCxx::cxxwrap_julia)

install(TARGETS
hello
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION lib)

hello.cpp:
#include
#include "jlcxx/jlcxx.hpp"

std::string greet()
{
return "hello, world";
}

double add(double a, double b) {
return a + b;
}

JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
{
mod.method("greet", &greet);
mod.method("add", &add);
}

mytest.jl:

module CppHello
using CxxWrap
@wrapmodule(() -> joinpath("/home/pablo/test_debug_cxxwrap/build/lib","libhello"))

function init()
@initcxx
end
end

CppHello.greet()

result = CppHello.add(3.0,5.0)

println("Resultado de la suma: $result")
a = 1

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/pablo/.julia/dev/libcxxwrap_julia_jll/override /home/pablo/test_debug_cxxwrap
cmake --build . --config Release

tried config Debug and the same happened
It is working perfectly , but when debug.....
Thanks

@barche
Copy link
Collaborator

barche commented Jun 2, 2024

I can reproduce this, but I don't know if it's a bug in JuliaInterpreter.jl or in CxxWrap.

@pablodecastillo
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants