Git Product home page Git Product logo

Comments (9)

Mike-Leo-Smith avatar Mike-Leo-Smith commented on August 28, 2024 1

Got it working. There were missing pieces in pre-processor

Wonderful to hear that!

from luisacompute.

trsh avatar trsh commented on August 28, 2024

Build LC via

python bootstrap.py cmake -f dx -b

Did cmake --install . in build dir afterwards

Created a new c++ project in VS2022 and added include directory from installs. Also switched to C++20 standards

from luisacompute.

Mike-Leo-Smith avatar Mike-Leo-Smith commented on August 28, 2024

Hi, @trsh

Directly including the installed directory in VS may lose some of the compile options and definitions we defined in the CMake build system. Therefore, you will have to manually add these missing definitions and options.

Here I collect some:

Compile Definitions:
#define _ENABLE_EXTENDED_ALIGNED_STORAGE 1
#define _CRT_SECURE_NO_WARNINGS 1
#define _UNICODE 1
#define LUISA_PLATFORM_WINDOWS 1
#define FMT_CONSTEVAL constexpr // missing of this causes the fmt error in this issue
#define FMT_EXCEPTIONS 0
#define FMT_HEADER_ONLY 1
#define FMT_USE_NOEXCEPT 1
#define XXH_INLINE_ALL 1

Compile Options:
/Zc:preprocessor
/Zc:__cplusplus

Additional definition if you enable the dsl feature when building:

#define LUISA_ENABLE_DSL 1

And for the gui feature:

#define LUISA_ENABLE_GUI 1
#define GLFW_INCLUDE_NONE 1

You may configure them in the VS project settings.

An alternative solution is to use CMake as your build system and add the LuisaCompute project directory (not the installed directory) as a subdirectory, so these configurations will be automatically propagated for you.

That said, maybe we should automatically generate a config header when installing to support other build systems. I will open an issue to track this need.

from luisacompute.

trsh avatar trsh commented on August 28, 2024

@Mike-Leo-Smith with these added now I only have problems with dsl/sugar

Screenshot 2024-01-03 110713

from luisacompute.

trsh avatar trsh commented on August 28, 2024

Ahh I messed up with the preprocessor, now I have only 1 error:

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error	C4996	'luisa::compute::Printer': The frontend-implemented `Printer` is deprecated in favor of the backend-implemented built-in function. Please use `device_log()` from <luisa/dsl/builtin.h>.	Lu	C:\Program Files\LuisaCompute\include\luisa\dsl\printer.h	143		

from luisacompute.

Mike-Leo-Smith avatar Mike-Leo-Smith commented on August 28, 2024

Ahh I messed up with the preprocessor, now I have only 1 error:

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error	C4996	'luisa::compute::Printer': The frontend-implemented `Printer` is deprecated in favor of the backend-implemented built-in function. Please use `device_log()` from <luisa/dsl/builtin.h>.	Lu	C:\Program Files\LuisaCompute\include\luisa\dsl\printer.h	143		

Looks like the deprecated warning is being treated as an error. Maybe adding a /wd4996 flag to the VS project settings will help?

from luisacompute.

trsh avatar trsh commented on August 28, 2024

@Mike-Leo-Smith yes, I just suppressed the warning, now I am down to linking libs.

Screenshot 2024-01-03 114523

Took it from reference, but smth is missing. Need to debug it properly

lc-vstl.lib
Shlwapi.lib
lc-osl.lib
lc-gui.lib
lc-dsl.lib
lc-api.lib
lc-runtime.lib
lc-ir.lib
luisa_compute_ir_static.lib
kernel32.lib
advapi32.lib
bcrypt.lib
ntdll.lib
userenv.lib
ws2_32.lib
lc-ir-v2.lib
lc-ast.lib
lc-core.lib
dbghelp.lib
lc-ext-stb.lib
lc-ext-imgui.lib
lc-ext-glfwdll.lib
lc-ext-eastl.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib

from luisacompute.

trsh avatar trsh commented on August 28, 2024

Got it working. There were missing pieces in pre-processor

from luisacompute.

Mike-Leo-Smith avatar Mike-Leo-Smith commented on August 28, 2024

I'm closing this issue since it's tracked in #118

from luisacompute.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.