Clemapfel / jluna

Julia Wrapper for C++ with Focus on Safety, Elegance, and Ease of Use
https://clemens-cords.com/jluna
MIT License
246 stars 12 forks source link

Installation Issue with MinGW_64 #41

Closed riatankarsahu closed 1 year ago

riatankarsahu commented 1 year ago

Hi, I was trying to install that library as I saw it supposed to be quite handy. But after several tries, I couldn't do it. After getting successful build I don't have the dll file in release or debug folder.

Build Command I used

  1. cmake .. -DCMAKE_CXX_COMPILER=<clang++> -DCMAKE_INSTALL_PREFIX=<E:\Jluna> -G "Ninja Multi-Config" (The CXX compiler identification is Clang 15.0.7)
  2. cmake .. -DCMAKE_CXX_COMPILER=<g++> -DCMAKE_INSTALL_PREFIX=<E:\Jluna> -G "Ninja Multi-Config"

I don't really get what's the actual problem I am sending the console and the build directory screenshot for further evaluation. If you help me, I will be grateful to you! Thank you in advance.

image

image

Clemapfel commented 1 year ago

I think your command contains -DCMAKE_INSTALL_PREFIX=<E:\Jluna> with a capital J but your folder is named jluna (with a lowercase j). Try modifying your build command to

cmake .. -DCMAKE_CXX_COMPILER=<clang++> -DCMAKE_INSTALL_PREFIX=<E:\jluna> -G "Ninja Multi-Config"

Then the .dll should appear in the folder you screenshotted

riatankarsahu commented 1 year ago

Hi, I tried, but didn't work. I am showing you the installpath, command and build directory screenshot. again. I think something is strictly mentioned in CMakeLists.txt file which is blocking the generation. If you allow me I can analyze the code, and if I find something, I will let you know. Meanwhile please have a look at the present status.

InstallPath: image

Build Directory: image

Console: image

Clemapfel commented 1 year ago

Have you executed make or make install? You're only showing me the output of cmake, you need to call make install in C:\Uers\Anticitizen\Desktop\jluna\build

Clemapfel commented 1 year ago

Also why are you putting the paths in <>, it should be -DCMAKE_INSTALL_PREFIX=E:\jluna instead of -DCMAKE_INSTALL_PREFIX=<E:\jluna>? The docs say to replace <path> with your path, you shouldn't also put your path in bracket. The same goes for the compiler argument

riatankarsahu commented 1 year ago

Yeah I have executed the build. Not with 'make' rather with 'ninja'. Sending the output to you, please have a glance at the text file. :) Output.txt

Clemapfel commented 1 year ago

None of these errors are triggered by jluna code, they are by your C++ standard library implementation.

I will attempt to reproduce this on a virtual machine (I don't have access to a windows workstation) and get back to you

riatankarsahu commented 1 year ago

Ok meanwhile I will also try to change the C++ version and try once again. Thank you so much! And also I have to mention this work in my thesis. So if you allow me to know about the research work you are doing on jluna, it would be great pleasure!

Clemapfel commented 1 year ago

Either way the fix for this will be a big windows-support PR which will take time.

If you'd like to fork jluna and try to make it work I'd be happy to review the PR and credit you as a co-author with getting Windows running. I assume it is related to how the C++ standard library is linked or included so I would expect the fix to either modify jlunas CMakeLists.txt or this header.

I don't have any development experience on Windows so (on top of not owning a physical Windows PC) I'm not very good at troubleshooting Windows issues but I feel like it was only a matter of time until this had to be done. If Julia is portable, jluna should be too

riatankarsahu commented 1 year ago

Honestly I would be happy to help with this issue. Thank you so much for your offer! I will start working on that since tomorrow. And will keep you updated.

riatankarsahu commented 1 year ago

Hello,

The problem is resolved. Your work is perfect! (Y)

image

An update I wish to add here, which is my research analysis so far. Yet we can't use clang/clang++/clang-cl/clang-cl++ as builder in windows to build that repository. The fact is 'libc++' isn't yet ready to be compatible with cxx_std_20 for windows. So the build will be failed. 'libstdc++' & 'libgcc' are fully compatible with cxx_std_20 but in that case we always need to select 'g++' as builder. Also I will recommend 'Ninja' as build tool for it's speed. If you wish to inform all the users about this feature, please mention this part in 'README.md'

So for that small amount of work I don't need the co-author title. But I need your details to put in my thesis, as I will use 'jluna' in my project as Julia -> C/C++ binder.

Once again thank you so much for your time and help!! Have a great weekend ahead!!

Clemapfel commented 1 year ago

Also I will recommend 'ninja' as build tool for it's speed

Users are free to use whatever build tool or linker they want, make comes with cmake so inexperienced users have one less thing to install, which is why I chose to not mention something like ninja, even though I personally also prefer to use it

I need your details to put in my thesis, as I will use 'jluna' in my project as Julia -> C/C++ binder

You can find details for the citation here

The fact is 'libc++' isn't yet ready to be compatible with cxx_std_20 for windows.

I will keep this issue open and investigate this, clang should work since gcc is hardly native to windows. Once I have the windows environment set up, I'll also try to get MSVC working

Clemapfel commented 1 year ago

Fixed by #46, closing