@Sean I claimed a task called 'Compile BRL-CAD with Microsoft Visual Studio Community Edition' so where do I can find the SVN checkout.
@Thusal Ranawaka I recommend to have a look at the more general task "[BEGIN HERE] Compile and Install BRL-CAD from source code". If you want to use Visual Studio the work is mainly the same, but the general task has more references in its description.
The "Compile with" tasks are for students, who already compiled BRL-CAD (in the general compilation task) and want to try another compiler/operating system now.
Hey @Daniel Rossberg the task that have you mentioned above seems to be an beginner task so is there any solution for that problem?
Also @Daniel Rossberg I claimed a task called RUN A CODE QUALITY ASSESSMENT ON OGV USING CODECLIMATE I do not understand what to do in codeclimate. Can you tell what to do step wise?
Hey Daniel Rossberg the task that have you mentioned above seems to be an beginner task so is there any solution for that problem?
Well, the solution would be to do the Visual Studio task instead. But, can you see the description of the general compilation task with the provided links?
Also Daniel Rossberg I claimed a task called RUN A CODE QUALITY ASSESSMENT ON OGV USING CODECLIMATE I do not understand what to do in codeclimate. Can you tell what to do step wise?
Never heard of it before. Let me see ....
... did you followed the steps from the task description? They look right straight forward.
On Code Climate you should probably do the quality thing (automated code review).
as an "Open Source" user.
Hey @Daniel Rossberg do you know how to add BRL-CAD/OGV-meteor repo to Code Climate I can't figure it out.
Did you cloned OGV to your own github account?
No. I don't know how to do it.
Did you googled for this? Google should provide you a link to the corresponding github help side.
I will try.
@Sean , I checked out the trunk from SVN and trying to compile it using CMake, I entered where the source code is and where to build, but I think I missed something. Because it shows this error, image.png
(deleted)
(deleted)
I don't see an error there yet.
Are you following the compilation/installation wiki page instructions?
be sure to do that...
Yes
So what's the next step?
This one know, https://brlcad.org/wiki/Building_from_SVN
Sean said:
So what's the next step?
Configure the build system with CMake
Okay, so have you pressed the "Configure" button?
Yes
It shows this, image.png
Scroll that bottom window up, what does it say in there?
You'll want to make sure you specified paths to the right folders for source and build
Sean said:
You'll want to make sure you specified paths to the right folders for source and build
I did it correct, path is direct to "brlcad" folder
So did you read the error message?
Seems pretty obvious what's wrong...
Yes, it says error at CMakeLIsts.txt
Dude seriously... keep reading.
There's literally just 4 lines and it says what the problem is in pretty plain terms on one of them.
So, you mean read the CMakeOutput file?
....no
This is the whole message,
CMake Error at CMakeLists.txt:85 (project):
Generator
Visual Studio 16 2019
could not find any instance of Visual Studio.
Configuring incomplete, errors occurred!
See also "C:/Users/Thusal Ranawaka/OneDrive/Documents/brlcad/build/CMakeFiles/CMakeOutput.log".
So you've apparently not seen this before and that's okay, but you should be able to read what you just pasted and realize what is wrong. What's it saying there?
It says, it can't find any instance of Visual Studio.
Bingo!
So, I have to specify it?
Do you know what that means?
The term "instance" may be confusing you.
replace "instance" with "installation" and see if that makes more sense to you.
So, it can't find the installation file?
who said anything about a file
if you replace "instance" with "installation", what is it saying?
Could not find the Visual Studio in my laptop?
I don't have Visual Studio to my new laptop yet, so, is that the problem?
it can't find an installation of visual studio
do you know what visual studio is?
Sean said:
do you know what visual studio is?
:face_palm:
I built LiberCAD V3 using Visual Studio
Okay... so then even more confusing to me how you got stuck on this error :)
cmake is saying it can't find visual studio. that's the compiler.
I never thought that you need VS when you are compiling using CMake.
Sean said:
cmake is saying it can't find visual studio. that's the compiler.
Oh.
if it can't find the compiler, it can't prepare the build system
if it can't prepare the build system, there's nothing useful it can do yet..
so it throws an error telling you it couldn't find a compiler for the environment it's trying to generate
Problem was I thought CMake was a compiler or act as a compiler, since I got less experience in it.
Okay
cmake configures the build environment, it's not a compiler
I'll download VS tomorrow, because my wifi is limited.
Sean said:
cmake configures the build environment, it's not a compiler
Okay
Sean said:
cmake configures the build environment, it's not a compiler
Same thing can be done in VS too know?
it writes out the files that tell a compiler how and what to compiler, and it supports lots of different compilation environments
Thusal Ranawaka said:
Same thing can be done in VS too know?
No.
because there are no visual studio project files yet
cmake generates the visual studio project files for brl-cad
Yeah
cmake could also generate them for a variety of other environments like Mingw or Ninja or Makefiles or ... but it defaults to Visual Studio project files on Windows since they're the most common on Windows.
LibreCAD can, I think because I set both environments and compiled in same Visual Studio
notice how the error message even says a specific version
Yes. Studio 2019
I installed Visual Studio yesterday, and I updated my windows, but Windows crashed during the restarting process. So, I had to reset my pc
It deleted VS
Thusal Ranawaka said:
LibreCAD can, I think because I set both environments and compiled in same Visual Studio
LibreCAD uses QMake which is a completely different build system generator
Oh, I see.
You likely compiled in Qt-Creator
I compiled it in VS, but I had to install Qt and set some paths to it.
That LibreCAD building almost took me 3 weeks work with Florian
You're gonna need to work on understanding the toolchains you're working with... what each of them actually does, not just follow a recipe on a web page :)
Yes
LibreCAD probably includes MSVC project files pre-generated from QMake, to make it easier for casual contributors
oh
Hey @Sean , slight problem, I generate the code after installing VS and compiled it the "BRLCAD.sln" solution file, and when I search the bin file I can't find mged application.
But others are there like, g-obj, asc-g, etc...
You'll want to make sure you compile the ALL_BUILD target
Okay
So, then the tutorial needs to be upgraded.
It's a wiki if you'd like to clarify or update it.
@Sean Hey, it still didn't work.
The mged isn't still there in the bin folder.
Not a useful statement if you're looking for help.. :)
I compiled ALL_BUILD solution as you said, but still there isn't the mged app.
There's so many things you could be doing or not doing that can affect compilation... Did it complete building the solution successfully or did it report error(s)?
If it reported errors, you got to look at what they were.
image.png This one know?
Sean said:
There's so many things you could be doing or not doing that can affect compilation... Did it complete building the solution successfully or did it report error(s)?
It completed with no errors, only some warnings.
So you're going to open the BRLCAD.sln solution .. and in there select the ALL_BUILD target.
not just select the ALL_BUILD.vcxproj file...
It shouldn't make a difference, but that's not something I can say I've tested
Here's what I did, I just double clicked the ALL_BUILD.vcxproj file and it opened in VS with all the files. Then I clicked "Build Solution", it took about 45 minutes to complete and it completed without errors.
It's there in the BRLCAD.sln, I don't know why it isn't building, image.png
@Sean , Build succeeded. image.png
Let's see whether mged is in the bin folder.
Nope. It isn't still there.
(deleted)
Thusal Ranawaka said:
Sean , Build succeeded. image.png
What makes you think the build succeeded in that picture?
Sean said:
Thusal Ranawaka said:
Sean , Build succeeded. image.png
What makes you think the build succeeded in that picture?
Yeah, concerning your question. It says 595 were succedded, another 300 failed.
I think I found the error, image.png
It says it can't find the brlcad_config.h file.
That file should be generated at configure time by CMake. Next question is why isn't it there?
starseeker said:
That file should be generated at configure time by CMake. Next question is why isn't it there?
Yeah
The CMake file generation went well.
I'll try the whole process from the beginning.
Okay, I just wanted you to know. Here is the brlcad_config file. So, I configured and generated the code from CMake from the beginning. image.png
Now I am building the BRLCAD solution with ALL_BUILD targeted.
@Sean Okay, here's the update. So, after the second build, 983 succeeded, 67 failed.
Noooo, it's not still there.
image.png This time error.
@Thusal Ranawaka brlcad_config.h is not the same thing as brlcad-config
Yeah, it needs to be compiled to become a header file, know?
Okay, the brlcad_config.h
file error never occurred after I started the whole process from the beginning. But there's a new error.
Associated with mged
Last time build, 595 succeeded, 370 failed.
But after starting the whole process from the beginning, 983 succeeded, 97 failed.
Still mged app failed.
Thusal Ranawaka said:
It says it can't a library file.
That doesn't look like the first error.
Yeah,
You have to find the very first error reported, it's the only one that matters.
I'll try the whole process from beginning.
okay
This time, I took a copy of the CMake Generation output to see if the error occurred there.
Now time for compiling ALL_BUILD target.
can you post the cmake output here?
more than likely, there's some recent change that broke the build on windows that needs to be fixed, but still good to make sure you're not overlooking a cmake failure.
Okay
@Sean CMakeOutput.txt
@Sean Okay, here are the results. It's the same error before. It can't find that .lib file.
983 succeeded, 97 failed. Build Failed.
Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file '..\..\Debug\lib\libtclcad.lib' mged C:\Users\Thusal Ranawaka\OneDrive\Documents\brlcad\build\src\mged\LINK 1
And during the build I saw, that stating "mged.vcxproj" file failed.
Here's the VS Output file, VSOutput.txt
@Thusal Ranawaka So again... you have to find the FIRST error, and what you screenshot was not the first error so it's useless.
Fortunately, you posted the VS Output file, which does make it easy to find the first error. To my eyes, this looks like the first error:
104>RC : fatal error RC1107: invalid usage; use RC /? for Help
104>
104>Done building project "tk.vcxproj" -- FAILED.
And that's a non-trivial failure that @starseeker may need to help with. Looks like libtk failed to compile, so everything that uses it also fails.
rc is the resource compiler... I'm building on windows myself, I'll see if I can reproduce.
@Thusal Ranawaka which version of CMake are you using?
starseeker said:
Thusal Ranawaka which version of CMake are you using?
@starseeker CMake 3.20.0-rc2
Hmm. I just built successfully - can you try with 3.19.6?
Okay
Hopefully that will give us an idea if CMake 3.20 is changing anything about their RC support...
Do you think it was an error that occurred when I was exporting the repo from Tortoise SVN?
You mean checking it out with TortoiseSVN? I doubt it - try running an update on your checkout folder to see if there is anything missing.
starseeker said:
You mean checking it out with TortoiseSVN? I doubt it - try running an update on your checkout folder to see if there is anything missing.
Yes
I did an update.
OK, you're probably good there then. That's why I suggested trying the stable CMake - it's possible that they've tweaked how RC compilation logic is generated in the newer CMake, and it might be causing issues.
Presumably it's the wish.rc file being added by src/other/tk/CMakeLists.txt that's causing the issue...
Hmm
I just finished Configuring and Generating.
OK, try building the "wish" target
We don't need to try the full build until we see if that works.
Okay.
This one know, image.png
Yes
No, build failed.
It's the tk file again.
Ah. OK, first thing - open the BRLCAD project or the ALL_BUILD project, not the wish project.
Okay. Did it
Once you've opened that, look for that wish target in the main project. Right now it's trying to build deps it doesn't know about.
Try building it from there - it should build the tk library first, then try to build wish.
starseeker said:
Once you've opened that, look for that wish target in the main project. Right now it's trying to build deps it doesn't know about.
That's how I did it.
I searched wish in BRLCAD.sln project.
Hmm. OK. Did you run "Build" or the build only this project option?
I ran Build, because there was no "Build only"option
If you right-click on the "wish" target, there's usual a series of options in the menu that pops up.
That's how I did it.
OK. Can you try building the "tk" target?
Ah yes, there's build only option. In the Project only tab.
starseeker said:
OK. Can you try building the "tk" target?
Only that target?
No, just try "Build" on the tk library. Let's see if that works.
It failed too. image.png
Ah, right - I forgot, tk also has a .rc file.
Yeah
OK, under Source Files for the tk target, see if you can find tk.rc listed
I am looking at the tk
folder right now, but can't find a tk.rc file listed.
So one other thing you can try quickly is to comment out line 673 in src/other/tk/CMakeLists.txt by prefixing it with "#" and re-running CMake, then trying the tk build again.
I don't know why that would cause an invalid syntax issue, but it's a quick test to rule it out
starseeker said:
So one other thing you can try quickly is to comment out line 673 in src/other/tk/CMakeLists.txt by prefixing it with "#" and re-running CMake, then trying the tk build again.
Hey there isn't a CMakeLists.txt file in that tk folder.
In your TortoiseSVN checkout
Not in the build directory.
starseeker said:
In your TortoiseSVN checkout
You mean the Checkout folder, know?
yes
Yeah, I checked there.
That's the build directory - you're in brlcad/build
You want brlcad/src/other/tk
This correct know? image.png
Yes.
Let's see if that changes anything.
starseeker said:
You want brlcad/src/other/tk
Sorry. I totally forgot that I was on the build folder.
So re-run CMake to regenerate the Visual Studio build files.
The re-open Visual Studio and try the tk target again.
If we still get the same error message, the next question is whether RC is correctly installed on your system.
ok
According to this, you need the SDK: https://discourse.cmake.org/t/cmake-rc-support-ninja/2883/7 (You're not using Ninja to build, but the RC tool is what we're trying to run on those .rc files)
Success!
Does wish build?
Yes.
Strange. OK, try the all-up build.
Building now
That line was added in r76799 so the wish.exe.manifest file could be found. I wonder why it's suddenly a problem now...
Hmm
So, is this .rc file essential for this mged build? or can mged run without that?
If I remember correctly, it's essential...
Can you launch a Visual Studio Command Prompt?
Also, if you look in the build directory for the CMakeCache.txt directory, what variables does it have set there that match the CMAKE_RC_* pattern?
I'll have a look after the build
starseeker said:
Also, if you look in the build directory for the CMakeCache.txt directory, what variables does it have set there that match the CMAKE_RC_* pattern?
@starseeker
//RC compiler
CMAKE_RC_COMPILER:FILEPATH=rc
//Flags for Windows Resource Compiler during all build types.
CMAKE_RC_FLAGS:STRING=-DWIN32
//Flags for Windows Resource Compiler during DEBUG builds.
CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG
//Flags for Windows Resource Compiler during MINSIZEREL builds.
CMAKE_RC_FLAGS_MINSIZEREL:STRING=
//Flags for Windows Resource Compiler during RELEASE builds.
CMAKE_RC_FLAGS_RELEASE:STRING=
//Flags for Windows Resource Compiler during RELWITHDEBINFO builds.
CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
Did the build fully succeed?
starseeker said:
Did the build fully succeed?
Yes
0 errors
/me blinks. OK, can you run mged, archer and bwish?
Yep
It works
So, build successful or do we have to look at .rc file?
OK. I'll comment out that line in the repo once I can verify a similar result here (at least until I can understand why we might need to put it back in, and how to do so without inducing breakage)
Okay
Let me know after you have done that.
I really don't understand why that line should break your build - if you can do it quickly, can you re-add it, re-configure CMake again and show me the CMAKE_RC_* variables from the CMakeCache.txt file?
I'd like to see what the difference is
Thusal Ranawaka said:
starseeker said:
Also, if you look in the build directory for the CMakeCache.txt directory, what variables does it have set there that match the CMAKE_RC_* pattern?
starseeker
//RC compiler
CMAKE_RC_COMPILER:FILEPATH=rc//Flags for Windows Resource Compiler during all build types.
CMAKE_RC_FLAGS:STRING=-DWIN32//Flags for Windows Resource Compiler during DEBUG builds.
CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG//Flags for Windows Resource Compiler during MINSIZEREL builds.
CMAKE_RC_FLAGS_MINSIZEREL:STRING=//Flags for Windows Resource Compiler during RELEASE builds.
CMAKE_RC_FLAGS_RELEASE:STRING=//Flags for Windows Resource Compiler during RELWITHDEBINFO builds.
CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
These are know?
I'm curious what they were before commenting out the CMAKE_RC_FLAGS variable in src/other/tk/CMakeLists.txt
if (MSVC)
set(TK_SRCS ${TK_SRCS} win/rc/tk.rc)
#set(CMAKE_RC_FLAGS /i${CMAKE_CURRENT_BINARY_DIR})
endif (MSVC)
This one?
yes
removing that fixed your build, so I'm wondering what about it was causing breakage...
Hmm
As far as I know, /i and the include directory is valid syntax for RC...
One single variable caused a whole build to fail.
That's not so unusual in and of itself, but I'm wondering why that particular insertion caused a failure. Your error message seemed to indicate the /i flag was invalid, which is why I'm curious about what ended up in the CMakeCache.txt file with it enabled.
I went ahead and committed the commenting out of that variable - if it breaks my build locally we'll have to figure out something else, but in the meantime you should be good to go.
(I'm done for the night - back tomorrow.)
Okay. Good Night!
starseeker said:
I went ahead and committed the commenting out of that variable - if it breaks my build locally we'll have to figure out something else, but in the meantime you should be good to go.
What areas won't work in MGED?
Did you check?
It seems to have built. I'll test functionally later, but for now it looks like commenting out that line can stand.
Okay
@starseeker Hey, were you able to regenerate the rc error in your local machine?
And why does this build folder took so much space in a Windows laptop? (just asking). The build folder is almost 8GB in my laptop. And the repo is almost 400MB.
I haven't tried to reproduce it - as long as everyone is building right now, that's enough. We're about to switch how we build 3rd party dependencies, and when we do we'll be using Tcl/Tk's own build system instead of our CMake. If we still see an issue after that, we should be able to enlist the community's help in addition to our own efforts.
Okay. Thanks!
@Thusal Ranawaka BRL-CAD is big and when yo compile, the compiler has all sorts of intermediate files it has to generate. They take up much more space than the source code itself. Also, I don't think that repo size you said is correct -- BRL-CAD sources alone are more than 400MB. Should be in the 1-2GB range.
Sean said:
Thusal Ranawaka BRL-CAD is big and when yo compile, the compiler has all sorts of intermediate files it has to generate. They take up much more space than the source code itself. Also, I don't think that repo size you said is correct -- BRL-CAD sources alone are more than 400MB. Should be in the 1-2GB range.
Yeah, I only checked out the trunk
Hey, So, if the migration to GitHub is done. I can try out my build from GitHub now, know?
What do you mean?
You can clone and build it, certainly...
Yeah
Or fork, clone, build if you like
So, when cloning I have to clone the whole repo know?
Because there isn't a trunk there.
The new "trunk" is called "main"
I see.
However, git works a bit differently than subversion - a clone is going to download the full repo history. Fortunately, Git ended up being much more compact than SVN when it comes to storing that history - your Git clone shouldn't end up being too much larger than your SVN checkout.
Now the Wiki needs an update too, about compiling BRL-CAD from Source using GitHub for newbies.
starseeker said:
However, git works a bit differently than subversion - a clone is going to download the full repo history. Fortunately, Git ended up being much more compact than SVN when it comes to storing that history - your Git clone shouldn't end up being too much larger than your SVN checkout.
Yeah. For that, I won't delete the SVN Checkout, I will rename it and store it in my laptop safely, to use when necessary.
It does. There's quite a lot of our documentation that will need to be updated. I'm currently making sure the build itself is working properly (our distcheck logic uses the version control system to get some information, and while I prototyped out a version using Git I now need to make sure it works in the final setup.)
Okay. Good Luck!
Blast. @Sean - something I never noticed until now. The tkhtml compilation apparently depends on having populated rcsid strings, so my stripping of those from the history during the conversion broke the tkhtml build.
I fixed it in main, but that means older builds will trip on the tkhtml build.
So, you found the error?
Yes. Latest main will build now. Working on a solution for older commits.
Okay. Great
Thusal Ranawaka said:
Now the Wiki needs an update too, about compiling BRL-CAD from Source using GitHub for newbies.
do you want to make the updates to fix the instructions?
Sean said:
Thusal Ranawaka said:
Now the Wiki needs an update too, about compiling BRL-CAD from Source using GitHub for newbies.
do you want to make the updates to fix the instructions?
Yeah, may be.
So, when building from GitHub repo, I have to clone this part know? https://github.com/BRL-CAD/brlcad/tree/main
I think it's just https://github.com/BRL-CAD/brlcad know?
Thusal Ranawaka@ThusalHP MINGW64 ~
$ git clone https://github.com/BRL-CAD/brlcad/tree/main
Cloning into 'main'...
fatal: repository 'https://github.com/BRL-CAD/brlcad/tree/main/' not found
Hey, I just cloned main into my laptop, and wanted to know the build instructions are the same know as in the wiki?
Build succeeded, image.png
This time, no tk errors.
And the mged runs too.
Excellent.
@Thusal Ranawaka I think I figured out the CMAKE_RC_FLAGS issue - that flag is used/needed when the Ninja generator is used. Once the repo is live again, I'll commit the proper fix.
Okay. Great
@starseeker : this might thrill/annoy ya :D https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256166
@Erik Oh, cool, that's interesting news to me. It might explain some other issues observed. Question is where those nulls came from.
I wonder if gold or mold (linkers) would noticeably speed up compile time :thinking:
hi , I have to install all GUI of brlcad separately?
or only build brlcad
@Neeraj Sharma What are you trying to do?
I just build brlcad
Okay, and what are you trying to do?
whether you need to install or build other things depends on what it is you're trying to accomplish
Did this build?
[5228/5262] Linking C executable bin\rtwizard.exe
[5234/5262] Linking CXX executable bin\brlman.exe
[5235/5262] Linking C executable bin\isst.exe
[5258/5262] Linking C executable bin\archer.exe
[5261/5262] Linking C executable bin\mged.exe
BRL-CAD Release 7.34.3, Build 20230521
Elapsed compilation time: 39 minutes 47 seconds
Elapsed time since configuration: 39 minutes 47 seconds
To build, launch Visual Studio and open C:/Users/jeram/source/repos/brlcad/out/build/x64-Debug/BRLCAD.sln
Build the ALL_BUILD target. To create an NSIS installer, build the PACKAGE target
Build All succeeded. (It looks like it built but not sure how many exe files. I removed my BRL-CAD install to make room)
But I get these 2 errors?
'C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe' '-C' 'C:/Users/jeram/source/repos/brlcad/out/build/x64-Debug' '-t' 'restat' 'build.ninja'
failed with:
ninja: error: failed recompaction: Permission denied C:\Users\jeram\Source\Repos\brlcad\ ninja
Error CMake Error:
Running
'C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe' '-C' 'C:/Users/jeram/source/repos/brlcad/out/build/x64-Debug' '-t' 'recompact'
failed with:
ninja: error: failed recompaction: Permission denied C:\Users\jeram\Source\Repos\brlcad\ ninja
The documentations said to change these flags to this:
BRLCAD_ENABLE_STRICT=OFF
BRLCAD_ENABLE_COMPILER_WARNINGS=OFF
BRLCAD_BUNDLED_LIBS=ON
I only found one of this flag:
BRLCAD_BUNDLED_LIBS=ON
But no easy way to change the flag and the other two were not present at all. Do I have to run an external CMake? I have the latest CMake installed and all my libraries are up to date. I'd rather use the one inside of Visual Studio because I kind of hate the external CMake. Didn't really expect this to build on the first try. I was surprised that it auto configured everything automatically. So I figured give it a try.
The error looks like https://developercommunity.visualstudio.com/t/cannot-build-cmake-solution-after-update-to-169/1367002. If updating Visual Studio does not help, using the stand-alone CMake should be a work-around.
Regardind the CMake flags: The only one I'm setting is CMAKE_INSTALL_PREFIX. I set it to a directory, where I can write in without becoming an administrator. In your case for example C:/Users/jeram/bin/brlcad?
The BRLCAD_ENABLE_STRICT is an "Advanced" flag. You have to hit the "Advanced" switch in the CMake GUI to see it.
The BRLCAD_ENABLE_COMPILER_WARNINGS flag had to be set (created) by you.
Few more changes to push, and still sans ogl, but Mac build is restored...
image.png
Last updated: Jan 09 2025 at 00:46 UTC