Sir I am having an issue.
I referred the compilation guides: -
http://brlcad.org/wiki/Compiling
http://svn.code.sf.net/p/brlcad/code/brlcad/trunk/INSTALL ----->(Quick Install)
I was successful till cmake part.
but my "make" command didn't work in both the cases.
I am getting the following error :-
"make: *** No targets specified and no makefile found. Stop."
i am running the commands in "VS015 x86 Native Tools Command Prompt".
can you please help me out.
thank you
@Mitesh Are you working on Windows with Visual Studio?
Yes sir.
I don't know somebody with name Sir here but OK: There should be a solution file BRLCAD.sln somewhere. Open it with Visual Studio (double click on it) and build the INSTALL target (or project).
I don't know somebody with name Sir here but OK: There should be a solution file BRLCAD.sln somewhere. Open it with Visual Studio (double click on it) and build the INSTALL target (or project).
Extremely sorry for addressing everyone as sir.
Thanks alot for replying. I will try the solution.
Extremely sorry for addressing everyone as sir.
Thanks alot for replying. I will try the solution.
No need to be sorry. I only wanted to mention that the usage of "sir" is extremely unusual in the open source community. If you want to address somebody special use the @ as in @Mitesh . Otherwise, simply ask your question and I'm sure that somebody will try to help you.
sure @Daniel Rossberg
I have build the INSTALL project but got 10 errors:-
can you please help me out.
thank you
These are CMake errors. What do you get when you run CMake alone?
when i ran the command in the process earlier it was something like this:-
task4.png
This doesn't look so bad.
Did you choose different directories for the source code and the build? The directory where you run cmake is the build directory where you can find the BRLCAD.sln afterwards. The first argument to cmake is the source code root directory.
Yes @Daniel Rossberg i chose different directories for the source code and the build
And I only downloaded zip file from:- https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Source/7.26.4/
not the other files. is that ok?
Using the files from the subversion repository would be better but the zip file should work too. For me it looks like the Visual Studio can't find CMake. When you started cmake for the first time you choosed your development environment, right?
@Daniel Rossberg i have gui of cmake....and when it was opened first time as far as i remember there was no option to choose anything, or maybe i don't remember
I'm using the CMake GUI too. When you press "Configure" there for the first time a dialog should pop up which lets you choose between the supported compilers.
I'm using the CMake GUI too. When you press "Configure" there for the first time a dialog should pop up which lets you choose between the supported compilers.
I remember that...
but I ran cmake command in vs15command line, and did not build it through gui.
There were errors while building INSTALL
but when I opened "Debug folder>> Bin>> I was able to run Mged.exe". Is it done?
if mged runs, then you're probably done -- screenshot?
But I would like to know how to solve the cmake errors.
that's definitely looking like a build of 7.26.4
Thank You @Christopher Sean Morrison
what cmake errors are you referring to?
not seeing them in the earlier discussion
those look like msvc errors, not cmake
okk... but how to solve them?
I tried one way out i.e by changing the cmake and build directories to another drive.
but got the same result
now did you run cmake?
s/now/how/
via gui or command-line?
command line
it shouldn't matter but try running it from the gui
you need to specify where the sources are and where your build directory is
(the first time)
okk... Thank You @Christopher Sean Morrison
I will try it.
no problem, that's why we're here
Should I add anything in "option toolset to use"?
er, picture please
probably not, but I don't recall that option
aha, no don't add anything
what version of studio do you have?
community edition?
2015 community
okay, then that looks fine -- did you run it?
yes....its running
yay!
I got this:-Capture4.PNG
should I press generate?
yep, that looks all good so far
for what it's worth, your compile more than likely completed 99% of the way
mged is one of the last steps, so that's a good sign
ok ...I have opened the project...and then after I will try to build the install project.
will update once its done.
thank you.
OH, did you run the install project the first time too?
yup
that's the problem -- run the ALLBUILD target
only ALLBUILD Target?
yeah, that will be fine
okk
bingo....build succeeded
I don't know the specifics on Windows, but I think the INSTALL target attempts to create a Windows installer, and you would need to have other tools installed for that
ok
whats the next step?
have you done any of the tutorials yet?
I suggest you try that next, just to get a little familiar with the tools, then pick a coding task and just give it a try :)
ok sure @Christopher Sean Morrison
thank you so much.
can you please send me the link of tutorials?
I don't have it handy, but you can find it on the site if you just search tutorial
there's two, part one is the first 8 lessons, part 2 is the second 8 lessons
you can do all of them or just the first one if your intention is to write code
what kinds of tasks sound interesting to you?
ok these tutoials
I already completed the first one
I am on verge of completion of second
when you say first one, do you mean lessons 1-8 or lesson 1 ?
lesson 1-8
ah, cool -- so got all your screenshots?
yup sir....this task was already approved yesterday.
i think it was approved you @Christopher Sean Morrison
yup sir....this task was already approved yesterday.
I appreciate your respect, but please know that it's VERY unusual to refer to people as sir when working in open source
very much not necessary, distracting even
sorry i forgot about that
no need to be sorry @Mitesh
@Christopher Sean Morrison i have one doubt.
once the "all_build" file is built, i could only find these files in the debug>>bin folder:-
Capture6.PNG
where are the other files?
hm, did you check up in the release dir?
I didn't see if you compiled debug or release
Its the same in release dir. No other files are there.
huh, was bin the same folder where you found mged earlier?
yes
that is odd
and it's the dir you fed to cmake
what was the msvc output?
there was no output
there's always output :)
it just might be hidden
i just go this result....Capture5.PNG
was msvc still open and running when you were running cmake?
quit msvc and try re-opening the solution
Hi @Mitesh , try the following: Start the CMake GUI, look for the CMAKE_INSTALL_PREFIX there, and set it to a directory where you have write access (e.g. H:/brlcad.install). Then build the INSTALL target. The issue with the ALLBUILD target is that it doesn't copy the files in the order of a BRL-CAD installation. This is what INSTALL does. The reason for the errors you experienced could have been that you hadn't write access to the install directory which is something in C:/Program Files/ by default.
huh, learned something new ... and I've built with the windows solution many many times
I don't recall ever having a problem with ALL_BUILD -- that's supposed to be the same target logic as make's default
Some things work in the build directory (Mitesh could successfully start mged) others may not. On Windows INSTALL simply copies everything into the right order, similar to Linux.
@Daniel Rossberg I tried your method....but built failed:-
Capture7.PNG
mahdi, okay -- we're exhausting options. I suggest you install Subversion and download the latest BRL-CAD source code from a repository checkout
quit msvc and try re-opening the solution
I also tried this but got the same result i.e built succeeded but only few files are present in bin folder
and see if you still run into a problem -- but basically starting over, and trying in a different location with the latest source code, and we can try some things
that said, I'm out for a bit -- have fun!
That is really strange. The install script complains about a missing regex.dll but mged can be started.
yeah, it's not adding up
i tries with svn....got this errorCapture1.PNG
I got the same error with today's svn checkout. The reason is that since yesterday the configuration requires a distinct C++ standard conformity but Visual Studio doesn't know about C++ standard conformity levels at all. I'll see what can be done there.
ok @Daniel Rossberg
@Mitesh You can now update from svn and give it another try.
He's probably Indian, They have tendency to use 'Sir' all the time.
He's probably Indian, They have tendency to use 'Sir' all the time.
we have many Indian developers that have contributed to the project over the years, so we know, but also using that designation is not limited to them -- it's a cultural norm for respect. part of our job introducing students like yourself to open source is to present what the open source cultural norms are as well.
with open source, it's incredibly rare to use titles and designations -- any title is usually earned through contributions, not through position or education, and they're rarely indicated during conversation
You mean 'everyone is treated same in open source'?
no, not necessarily
our community, for example, operates as a meritocracy
the more you contribute and the more you do, the more you get a say in what gets done, what others can/cannot do
@Mitesh With the latest svn revision I could successfully build the INSTALL target.
ok @Daniel Rossberg i will try it after some time.
Ya...i am from India:)
@Daniel Rossberg Still facing the same problem when i built install in visual studio
which problem is that?
sounded like the issue was building a mixture of mingw and msvc when the whole stack should really be msvc only
if you remain stuck, we can get you set up in a virtual machine where everything is preconfigured and more seamless
@Sean its fine..got a good news.... I just tried again and it worked
Naseef : He's probably Indian, They have tendency to use 'Sir' all the time.
Well, I've met some Indians in IRC, Chats, and Forums and helped them to solve some small problems, Most of them called me 'Sir' at least once within the conversations.
I know it's irrelevant, But I had a little anxiety about saying it, So I wanted to clear it up
:wink:
@Mitesh Congratulations! :tada:
Should I install BRL CAD on Windows or Linux?
On whichever system you feel yourself more comfortable. Both should work.
I'd go with Linux then.
How much storage space I'll need? I have around 600 mb left on Ubuntu partition.
My build directory has 2.3 GiB. I performed only a single standard build there. Therefore, I would say you are in trouble :(
@Naseef a complete build+compile usually takes about 2GB-6GB depending on your OS/filesystem
Oh, Well. I have around 32 GB unallocated space left on my disk, unfortunately I already have 4 primary partitions.
Windows partition has around 30 GB left, But Windows is always in Unsafe State.
Files partition have 4.5 GB left, I think I can build it there.
The souce code, the build, and the installation can be on different partitions.
So I can keep the source and build in Files partition and install it to Ubuntu partition?
sure, and for most tasks, you don't even need to install (you can run from the build tree)
Yep, set CMAKE_INSTALL_PREFIX to a directory in your Ubuntu partition, that's it.
That's good.
Is there a Git repo for BRL-CAD?
or Just SVN?
the website and ogv tasks are in git, the main code is svn
Does BRL-CAD SVN have both MGED and Archer?
yes
and 398 other tools ;)
:cold_sweat:
most are very small tools that do one specific thing
:relieved:
there are only 4 larger gui tools: mged, archer, adrt, and rtwizard
Build takes pretty long as I expected.
Is this okay?
/mnt/Files/Home/Dev/brlcad/src/librt/primitives/dsp/dsp.c: In function ‘get_obj_data’: /mnt/Files/Home/Dev/brlcad/src/librt/primitives/dsp/dsp.c:4087:9: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint32_t {aka unsigned int}’ [-Wformat=] bu_log("ERROR: Binary object '%s' has invalid data (expected type %d, f ^
I've seen similar warnings a few times now, Hope there is no problems.
Well, It's a conversion, Won't harm right?
it's fine -- we fix those types of things just to keep things clean, but they aren't problems. we turn on a LOT of things the compiler can warn about, way more than most.
helps us keep code quality higher than would naturally happen across a 1M line codebase
if you want, you could work on fixing all the warnings you encounter -- can make a gci task out of it if there's enough work
let me know how many warnings or post a full log and I can take a look if it's worth it
I think there is more thank enough warnings :joy:
unlikely they amount to more than a few minutes of work
I can see more about 50-100 warnings
it might seem like a lot if you've not worked with large codebases before ;)
that's probably about an hour's worth of work
Of course!
that's borderline, but if you want to learn and give them a try, let me know and we can create the task for you
I've compiled large codebases with visual studio.
how big? :)
Torque3D
and studio turns nearly everything off by default
I've seen a lot of warnings there too!
i'm not familiar with how big torque is these days
last used it nearly 10years ago
At least, You've used it.
Torque3D is what made me learn C++ :D
if you know c++, then that dsp.c warning should've made sense, no?
What?
I haven't really coded much C
it's good to not ignore warnings from compilers, and is something we do as a matter of standard practice (we tell GCI students to turn strict compilation off because most haven't learned how to read or address warnings)
that warning was not specific to C
same in C++
I can understand what that warning means
long long unsigned int a; unsigned int a; b = a;
something similar is happening there I assume.
not exactly, the warning is partially about types, but more about format specifiers
it's more like you have some function:(unsigned long long a);
function(unsigned long long a); unsigned int b; function(b);
except instead of function(), it's a format specifier (%llu) being passed a size_t (unsigned long)
upconversion from a smaller size to a larger size isn't generally a problem, so the warning is lame -- but valid - do you know what the fix should be?
the variable passed to the function should be long long unsigned int
Or like this :
function((unsigned long long)b); // casting b as unsigned long long
casting is one solution, think of any others?
casting might be appropriate if the %llu was significant for some reason
Oh well, I kinda understand I think
in this case, the warning said the type is uint32_t ... which isn't completely accurate
it's a size_t
printf("Here is my long long unsigned number : %llu",longnum);
this how %llu
is used right?
yes
now make longnum a size_t
if you compile with -Wformat, you should get the warning
gotta run, but play with that and see if you can find a better fix than casting ;)
I'm on it!
clue, run "svn annotate" on that file and run "svn diff -cREV" on the last change to that line
Build successful!
svn: E155007: '/mnt/Files/Home/Dev/src/librt/primitives/dsp/dsp.c' is not a working copy
Looks like there's something wrong.
Finally, Completed the task and submitted for review!
Time for a real coding task now, The PDF file had a funny warning, It's really funny.
Hope I won't need an Electro-Shock therapy to complete this task!
Hey! What do we do with brlcad/.build/doc/
?
svn: E155007: '/mnt/Files/Home/Dev/src/librt/primitives/dsp/dsp.c' is not a working copy
That's because you apparently downloaded the 7.26.4 sources instead of pulling a checkout from SVN. You'll need to redo the build with 7.27.0 sources checked out from SVN at some point.
Oops.. Yea. ASAP
Do I have to re download everything? Or just the ones modified?
you'll have to re-download everything (using svn checkout, not a file download)
well, I mean...
I have brlcad
in dev
folder.
I checkout BRL-CAD from svn to brlcad
from dev
.
Most of the BRL-CAD source files are already in the brlcad
folder.
Now, Will it download all files and overwrite everything or download only the modified files and new files?
CMake Warning (dev) at CMakeLists.txt:22 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 2.4 is not supported by CMake >= 3.0. This warning is for project developers. Use -Wno-dev to suppress it. -- Could not locate 'brlcad-config' - no BRL-CAD version available -- Found BRL-CAD at /mnt/Files/Home/Dev/brlcad/ -- Configuration for 'ge'... Omitted. -- Configuration for 'coreInterface'... Omitted. CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: BRLCAD_OPENNURBS_HEADERS_DIR used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge TCL_INCLUDE_PATH used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/coreInterface used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge used as include directory in directory /mnt/Files/Home/Dev/rt^3/tests/libge -- Configuring incomplete, errors occurred! See also "/mnt/Files/Home/Dev/rt^3/build/CMakeFiles/CMakeOutput.log".
WhereOPENNURBS_HEADERS_DIR
and TCL_INCLUDE_PATH
are located.
YOU SHOULD INSTALL BRL-CAD BEFORE COMPILING AND INSTALLING RT^3
How?
make install
in the brlcad build directory
in rt^3 configuration set BRLCAD_BASE_DIR to the installation path
Could not locate 'brlcad-config' - no BRL-CAD version available
/usr/bin/ld: cannot find -lcoreinterface collect2: error: ld returned 1 exit status tests/coreInterface/CMakeFiles/printTitle.dir/build.make:94: recipe for target 'tests-bin/printTitle' failed make[2]: *** [tests-bin/printTitle] Error 1 CMakeFiles/Makefile2:165: recipe for target 'tests/coreInterface/CMakeFiles/printTitle.dir/all' failed make[1]: *** [tests/coreInterface/CMakeFiles/printTitle.dir/all] Error 2 Makefile:94: recipe for target 'all' failed make: *** [all] Error 2
@Naseef I've just tested the coreinterface build from scatch, i.e. starting from an empty build directory. And surprisingly enough, it worked without any additional interaction, setting CMake variables, etc.. All I did before was to install BRL-CAD and adding the BRL-CAD installation bin directory to my path environment variable.
PATH=$PATH: [BRLCAD_BUILD_BIN] cd rt^3/build cmake ...
Output is too long...
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: BRLCAD_HEADERS_DIR BRLCAD_OPENNURBS_HEADERS_DIR TCL_INCLUDE_PATH
Where is the TCL_INCLUDE_PATH?
@Naseef I've just tested the coreinterface build from scatch, i.e. starting from an empty build directory. And surprisingly enough, it worked without any additional interaction, setting CMake variables, etc.. All I did before was to install BRL-CAD and adding the BRL-CAD installation bin directory to my path environment variable.
I am on linux, so, I have some problems.
I have only 1 day remaining to complete this task, Any help would be really helpful.
I did my test on Linux too. (I need to test it on Windows some day.)
Did you installed BRL-CAD with make install
?
Yea
Should I install again?
(deleted)
ran make install
[100%] Built target buildtimedelta Install the project... -- Install configuration: "Release" CMake Error at cmake_install.cmake:36 (file): file cannot create directory: /usr/brlcad/rel-7.26.4/include. Maybe need administrative privileges. Makefile:126: recipe for target 'install' failed make: *** [install] Error 1
should I install as root?
ran make install
as with sudo
, did I just do something wrong? it worked tho.
I still can't build rt^3.
same errors as before.
@Naseef You can set the installation directory in CMake with CMAKE_INSTALL_PATH. I'm usually using a folder in my home directory.
Now, that you did the first thing of what I wrote in bold letters, have you done the second to?
Ooh yeah! It compiles now!
Thanks a LOT!
How do I compile rt_shootray example? Does it have to be compiled alongside BRL-CAD?
How do I compile rt_shootray example? Does it have to be compiled alongside BRL-CAD?
there's a comment in the example that may help for manually compiling it on linux, and it's build as part of compiling brl-cad via cmake
Is there a guide as to how to export the raytrace into PPM or other image formats?
jeff, ppm is a crazy simple format that can be written out using printf/cout
@Jeff Sieu check out this discussion thread: https://cboard.cprogramming.com/c-programming/160019-need-help-printing-circle-ppm-image.html
basically, you print a simple text header (P6 on one line, width height 255 on another) and then your bytes in rgbrgbrgb... form
Okay, I'll have a look at it. I presume that the output image has to be produced from the coordinates given by the points of the raytrace?
which task are you working?
Trying Appleseed #2
ah, yes -- the image should reflect rays that hit or miss
rtexample shows how to set up a hit/miss callback, the task is to make sure you understand the basics of how that works and to get a grid of rays set up
Oh I see, so just to clarify -- a grid of rays refers to multiple individual rays right?
yes
lots of examples throughout the code like this one: src/libanalyze/inside.c
look for rt_shootray or rt_pattern or rt_gen_ for starters
(for more examples)
Oh cool, I'll check them out thanks
Has anyone here actually compiled the sources using the MSVC compiler?
I was wondering how long build+compilation would take
I've followed the installation instructions and can't seem to compile (successfully) more than 400 or so projects -- among which include mged and archer. I've heard that other people have had similar issues so is there a resolution that hasn't been included in the installation txt file?
Yup this was precisely my problem
Are you doing the compilation task
I think this is an actual problem -- may be something to do with the compiler version im not too sure but @Daniel Rossberg said that it worked on visual c++ 2010 or smth
The build with Visual Studio 2017 seems to be broken. The declaration of lrint() doesn't get detected during the configuration which leads to an error for most of the source code files.
For the compilation tasks, we just have to download the compiler and run cmake with -gcc or -clang or so right?
Beside this there is an issue with src/libbu/parallel.c. Renaming every WIN32 to _WIN32 there should solve it.
On MS Windows only Visual Studio is known to work.
But I have macOS. Actually I've succeeded to run mged -gcc and mged -clang but I'm just wondering if it's enough
with the flags of course
If you where able to run a self compiled mged it's enough. Submit a screen shot whit the output of the rt command and you are done.
Alright thanks! I'll do it as soon as my current task is approved
Hm, I'll try investigating some more.
@Sean @Daniel Rossberg
Having to work with CMake really motivated me to start using it to build some of my own side projects. Recently I've been trying to use a command line parser for cmake and was wondering if you guys could guide me on the right path. If I wanted to just take simple commands / flags from the compiler and store them in a variable for cmake to use (like set folder directory -> x) how would I go about doing that? Would I need to define some sort of macro or function?
Please create a new subject for different topics, but the brief answer is that you don't need to do anything. You just set a variable and it'll be available to you (cmake -DMY_SPECIAL_VAR=/some/folder/here ...).
The build with Visual Studio 2017 seems to be broken. The declaration of lrint() doesn't get detected during the configuration which leads to an error for most of the source code files.
even it is not recognised in visual studio community 2015
In my case i first build the whole project and then build only "install"...which gave me mged
Any thoughts as to why it might have been broken with VS 2017?
Would defining LRINT in the common.h for MSVC version > 1900 (2015) help? Has anyone else tried this?
Sorry...I haven't tried that..
@Mahdi it's because msvc (finally) added support for lrint() very recently
we did recently add macros and improved the testing, so something may be wrong in the cmake logic -- someone has to look at the CMakeError.log to see why it's thinking that lrint() isn't available or doesn't work. the lrint test happens in the top-level CMakeLists.txt file around line 2698
if someone wants to debug and fix that, we can add a task for it ;)
I wouldn't mind trying to fix it. It's weird because CMake finds lrint and defines it in the header but still can't seem to compile it. My guess is that it's related to the ucrt libraries since those are the errors that keep popping up.
I found this on the official CMake documentation notes:
The InstallRequiredSystemLibraries module learned a new CMAKE_INSTALL_UCRT_LIBRARIES option to enable app-local deployment of the Windows Universal CRT libraries with Visual Studio 2015.
I don't think it's a coincidence that version above 2015 aren't compiling. There's definitely some issue with the UCRT and CMake.
That's probably more to do with the dlls though
10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h(20074): error C2059: syntax error: '}' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h(20075): error C2059: syntax error: '}' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h(20076): error C2143: syntax error: missing '{' before '*' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h(20084): error C2061: syntax error: identifier 'IMAGE_POLICY_ENTRY' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h(20085): error C2059: syntax error: '}' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h(20086): error C2143: syntax error: missing '{' before '*' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\processthreadsapi.h(1126): error C2059: syntax error: 'constant' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\processthreadsapi.h(1128): error C2059: syntax error: '}' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\processthreadsapi.h(1250): error C2059: syntax error: 'constant' 10>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\processthreadsapi.h(1252): error C2059: syntax error: '}'
Anyone know what these errors could mean?
Where do I find the cmake build log?
in gui?
linux terminal
if in gui cmake build log are found in a space under the generate button..Capture3.PNG
sorry no idea for linux terminal...
i think it shhould be same as that of cmd in windows. Check the build folder..
@Naseef have a look into CMakeFiles folder which is in your build folder, there you should find CMakeOutput.log or CMakeError.log
Is it Ok if I built it without GUI? I reinstalled Ubuntu so it built without a GUI. Will rebuild with GUI soon
Sure, building witout GUI is fine. I've commented on your task how to get the build log.
See https://brlcad.org/wiki/Compiling for the additional packages needed to build with GUI on Linux.
Hey @Naseef As far as Ik there will be a txt file named build log in the source folder
Yeah, Found that. I'll rebuild it with GUI and send the logs. Thanks.
Makefile:162: recipe for target 'all' failed
after a half hour build
make again with VERBOSE=1
Which version of Qt is required for BRL-CAD?
well, I know it was optional.
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:44:10: fatal error: X11/extensions/XInput.h: No such file or directory
#include <X11/extensions/XInput.h>
I failed to install something?
I have to rebuild everything again because I reinstalled Ubuntu.
xinput is already the newest version (1.6.2-1build1).
Would it be reasonable to put fmax and lrint into a namespace? I really don't know how else we can resolve the ms build without renaming them. I tried to include cmath but it seems cmake is building the files using a c compiler so it can't work.
the cmath thing was a little silly I'll admit
I think you don't have to change source files to get it compile
Maybe change cmakelists?
include the source dirs
Well, the issue originated because there are multiple definitions of lrint and without the definition of lrint the solution doesn't compile
If I make it only define lrint for msvc less than 2015 then it just bombards me with a bunch of syntax errors
@Naseef xinput "should" have been optional if you're using a source checkout. if you're not, you maybe needed to rerun cmake ... if you are using a checkout and ran cmake fresh, then I'd love to see your log files since something didn't test right.
Would it be reasonable to put fmax and lrint into a namespace? I really don't know how else we can resolve the ms build without renaming them. I tried to include cmath but it seems cmake is building the files using a c compiler so it can't work.
it depends ... there's already testing and wrapping going on for them so we must first make sure that those tests are passing/failing correctly and that the problem isn't something more simple like a cmake test that failed when it should have passed
Well, the issue originated because there are multiple definitions of lrint and without the definition of lrint the solution doesn't compile
this would be because of the other wrapping going on. you can't just define or not define them -- you have to know, for example, if it's already defined to something and what happened during testing
if it doesn't build for either of you, please post a log of the entire output from cmake on a fresh checkout
@Sean What could cause the CMake test to fail?
The problem is in the detection of the lrint() declaration (see the main CMakeLists.txt line 2698ff). Interestingly, lrint() seams to be the only function where the DECL_TEST_SRCS is used. And, somehow the test in line 148 of misc/CMake/BRLCAD_CheckFunctions.cmake fails.
If you want to rerun the test you have to remove the lines with LRINT from CMakeCache.txt. Then you'll see that the configuration finds the lrint() function but not its declaration. The test source in lrint_decl_test alone can be compiled with Visual Studio 2017. The next step would be to debug check_c_source_compiles() to find out why it fails.
However, I'm possibly on the way to find a simple work around.
Compiling BRL-CAD with Visual Studio doesn't work because of https://core.tcl.tk/tk/info/3d34589aa0ae079039e2e2a60a5ed67c0056836d
The work around for the lrint() issue is:
what if you install tcl/tk manually (from a binary distribution) before running cmake?
Is the declaration issue associated with the tcl/tk bug? Why would all the "have decl" fail?
One would suppose those two to be unrelated, no?
what if you install tcl/tk manually (from a binary distribution) before running cmake?
@Sean It depends on if both sides have to use the same C-runtime or not. I'm afraid they have to use the same what means they need to use the same compiler.
One would suppose those two to be unrelated, no?
@Mahdi Right, the lrint() declaration and the Tk issues are unrelated. I found a work around for the first one and run into the second then.
@Daniel Rossberg not sure I follow -- you mean there's some C-runtime incompatibility if we install a system tcl/tk (say compiled with msvc2012) and compile our C code with a newer C-runtime (say msvc2017)? I'm aware of issues with the C++ STL runtime across DLL boundaries, but never heard of a C-runtime incompatibility. And even then, it would have to be across a DLL boundary ... where is that happening?
@Sean I you malloc() memory on the one side of a DLL boundary and free() it on the other side you have to make sure to use the same ledger. This can be done by using the same C-runtime DLL on both sides, e.g. malloc() and free() will always be calls to this mscrt~.dll. But, if they are using different versions of mscrt ...
I'm still incredibly surprised that A) there's an incompatible call somewhere in the C runtime (rarely changes, much more surprised the malloc/free would be one they made incompatible) and B) that we so that somewhere, e.g., getting memory from Tcl_Alloc without calling Tcl_Free
I'd think B is worth fixing if we do that anywhere regardless
That's not an "incompatibility" but a consequence of the global static memory ledger in the C library. In principle it's the same on Linux, but there everybody is using the same libc and that's way it's fine.
Using something like Tcl_Alloc() and Tcl_Free() is the usual work-around.
I know that in theory it's possible (on Linux or on Windows), I'm just not aware of this being an issue ever for the C runtime in practice, at least not anywhere in the brl-cad code -- have you seen a failure or is this hypothetical? because I recall (years ago) having installed system tcl/tk on windows, compiled against it with what had to be a different msvc .. maybe with all the c11 changes stuff happened?
It's an old issue, especially of MS Windows programming, not connected to C11. The cause is simple: There is a global structure which keeps record about the memory retrieved from the OS and the peaces of the given to the application logic. If you use one structure in malloc() and another one for free() the second one doesn't know about this part of memory and may panic. And, whenever somebody doesn't look at this a crash is likely. It isn't a hypothetical issue. That's why e.g. the Object class in the C++ core interface has a Destroy() method.
Curiously, I couldn't find a way to not use libc on Linux. Even llvm uses it. (But I hav't tried the Intel compiler there.) BTW, if you try to start on a new system compiled software on an old one, it'll complain about the libc version even if it's only a "Hello World!". (Can one set the libc compatibility as a compiler option?)
BRL-CAD in general is fully compiled with the same compiler, and on Windows the parts (DLLs, EXEs) are using a/the same C-runtime DLL.
In case of TCL/Tk it looks like if Tcl_Alloc() and Tcl_Free() are used the right way than it could work.
I meant hypothetical in the sense that you've observed it crash brl-cad code somewhere because of this issue -- I know the problem "can" happen. I'm just surprised that it's actually happening because that's usually bad code. You should always be alloc/free'ing on the same side; you should always open/close on the same side, etc. For there to be an incompatibility, it suggests somewhere that is being violated.
The libc compatibility on linux is related, but usually triggered by the linker's version checking. Even if there's not an issue, it will abort/complain about the version. You can get past it, but it's a little tricky. Had to do that for some HPC assets a while back compiled against old RHEL, running on newer.
Speaking about BRL-CAD, I hadn't observed such a memory management issue (or I can't remember).
I had a similar appointment of writing a small program for an old Red Hat. I ended up installing an old Fedora Linux in a VM.
CMakeOutput.log Is there something wrong with my CMake output? It doesn't compile
here is my build.log
Can someone help me? Please
Yes, i'll try
even i have a doubt in Compilation of BRL-Cad source, after the cmake step many things show - failed , so is that ok ?
Yeah, you don't need to see 'success' on each line
yea, not even 'found'
If you didn't do anything strange you should be fine
So the build is ready , now to compile the documentation says 'make ' command while that is an unrecognizable to cmd
are you in the build directory?
yea BRLCAD/brlcad-svn-trunk/.build/
Wait, you're using Windows
Yea , :smiley_cat:
Which generator did you use cmake with
Instead of make we can use MS vS studio in Windows
If you used the 15 generator you're out of luck mate
I think you'll have to open the .sln
^ Oh yeah that too
I opened the BRLCAD.sln
Run the BRLCAD-SLN>> "INSTALL" in visual studio...and make sure that in cmake you have changed the installation folder to som place other than C: or C:>>program files....
what is 15 generator? @Mahdi
I was assuming he was using the latest visual studio (2017)
Ohk...
cmakepredefinedtargets\INSTALL
You assumed right . @Mahdi
I did it in visual studio 2015
got some positive results..(it wasn't 100 % successfull)
Run the BRLCAD-SLN>> "INSTALL" in visual studio...and make sure that in cmake you have changed the installation folder to som place other than C: or C:>>program files....
Run or Build ?. ALso i have kept nothing in the C:\ drive
Build
btw, i can reclaim a task which i ran out of time to complete , right ?
As long as it's still there when you search for it
Yea,, it is there :)
by the way i already have BRL-CAD (ReadyMade) installed, that would that create any problem ?
No, that wouldn't be the issue
The build is broken for the latest version of visual studio
Daniel is currently trying to find a workaround
so,I would have to revert back to my old version ?
I would personally recommend using linux
in VMware station would be fine, right ?
Should be fine, but why not just dual-boot
Yes, but wouldn't that take more time ?
If you have enough ram for the vm you should be fine
Ubuntu is best of all ?
I don't like ubuntu
Have you ever used linux?
Nope, once i installed ubuntu but i don't remember when
Yeah Ubuntu would be the best then
Somehow once I went Ubuntu, I've not gone back to Windows
Cool
Once u-bunt, u-want.
Okay that was bad but the effort is what counts
i didn'teven get the joke but A for Effort. :laughing:
That was so bad
I want a mod to delete that please
I am ashamed.
HAha :rolling_on_the_floor_laughing: :rolling_on_the_floor_laughing:
my compilation in visual studio 2017 is done
2924 errors 638 warnings
build Install.vxcproj - failed
2924 errors 638 warnings
count of errors in visual studio is practically meaningless
there can be exactly 1 thing wrong, 1 character, in 1 file .. and it will result in thousands of errors (basically everything fails)
no, waiti am attaching the error log
all that matters when compiling is the command that was run and the first error that resulted
so did you read it?
Yes, kinda
it's basically 1 error ... printed thousands of times
I can't figure out most of it
Yes,
there may be two errors in there, but again all that matters is the first error
it's basically 1 error ... printed thousands of times
btw @Mahdi told that Visual Studio 2017 has problems in building the Code for BRLCAD
more specifically, Visual Studio 2017 has problems building Tcl/Tk
which is bundled and being compiled
So, what should i do now ?
Rahil, if you're up for a test, try installing tcl/tk from a binary distribution
Rahil, if you're up for a test, try installing tcl/tk from a binary distribution
I'll check it up
https://www.activestate.com/activetcl/downloads
This will resolve the issue ?
I'd try the 8.5.18.0 installer
uhm ... "Rahil, if you're up for a test, ..."
OHHH, ok i am up :up:
Done, i installed the Tcl/tk . now should i build the INSTALL again ??
yes, but you'll need to pay attention CLOSE attention when you run cmake
you need to tell it where tcl/tk is installed
i have to run cmake again. ? or just from Visual Studio
and the summary needs to indicate that it will be using that version
you have to run cmake again
it's not going to magically find it :P
you should delete your build directory
start fresh
OK
so i run cmake from command prompt so how can i tell cmake to look for the directory ?
doesn't matter -- you can use cmake gui
I'd probably use cmake gui, but just running generate probably won't work -- you have to run configure and then it'll display a list of variables
then you have to find the variables related to tcl/tk and set them, pointing them at where you installed activetcl
td;dr can someone tell me what are the dependencies missing? Have anyone successfully compiled brlcad on 17.10?
what error are you seeing?
or conversely, what's the cmake summary?
I posted the log above, I've been stuck there for about a week now
https://brlcad.zulipchat.com/user_uploads/1549/NX9OArlnnQT1_s1c1rTruplU/build.log
https://brlcad.zulipchat.com/user_uploads/1549/8Li6FaPDcxg-5UfgMr9GXe6a/CMakeOutput.log
brb, looking
"Qt support (optional) .................: OFF" - I need GUI
okay, thanks...
@Naseef you don't need qt support for BRL-CAD -- that's an experimental interface
cmake summary looks good
@Naseef aha, so did you read the build log? what's the first error you see?
@Naseef after answering that -- I just applied an update that should get your further. run "svn up" then make again
@Naseef that was a build system bug, so feel free to claim the bug report task and I'll give you credit for finding and reporting it well -- just upload those two log files again
Well, Was it a bug? I'll find it.
@Naseef what was the error you saw in that log?
reading compilation logs is a rather valuable skill
as is reading all the messages written to you -- I answered your question but you didn't answer mine ;)
Well, I was trying to fix the bug while watching cat videos on youtube.
XInput?
is that a question or an answer? :) what about XInput?
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:44:10: fatal error: X11/extensions/XInput.h: No such file or directory
#include <X11/extensions/XInput.h>
It's missing
xinput is already the newest version (1.6.2-1build1).
so you have xinput (the library) installed
yes
that does not mean you had the headers installed
which are a separate package
so you could have installed them and it would have succeeded
like xinput-dev?
something like that BUT I just changed the code so it should just work for you
try "svn up" then retry your build (make)
should I svn update?
up = update?
yep
how do I see the changes?
changed lines?
i also went ahead and fixed all those silly warnings
That's great!
now I'm deleting everything in build directory and starting again
I cleaned up some other things at the same time, but you can see what changed with: svn diff -c70572
you don't need to
Oops, I just did!
helps to learn what each step actually does when compiling so you don't waste time :)
if you'd installed or uninstalled something, you'd need to delete your build or re-run configuration (cmake) without any cached results
you were past that, you were compiling
the error was a compile error, the compile error was fixed, so there's nothing needed -- you just compile again
Well, I understand. But deleting it won't harm right?
if you'd finished compiling and were looking at a link error, then you "might" need to "make clean", but even then usually just make again will work fine
it harms YOU if you get in a habit of just doing that or not doing that without learning when you NEED to do that :)
;)
I see a lot of 'failed' in tests
and some 'not found'
yes?
cmake is called a configuration step because it probes your system, to figure out what you have and do not have
so it knows how to configure the compilation, what features to turn on or off
well, when someone is compiling for distribution, which will be running on different systems, how the configurations works there?
pretty much the same, because you build for a given configuration
it's testing to figure out whether it's linux, windows, mac, bsd, etc, and what types of each
[ 43%] Built target libged-obj
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
I think I should run a verbose build
As stated in an earlier thread, pasting the end of a log or the last error message is rarely informative. Don’t do that. Post the FIRST error and if not simply make or cmake, the command that preceded it.
The full log or verbose log are the step after, usually a request when someone fails at reading their log or something exceptional has happened and we want to know how it happened.
Don’t jump to that step. Read your log and find the first error first, then read it, then google it and ask for help understanding it (usually in that order).
A few warnings at 34%
more warnings here and there starting at 34%
first error at /home/naseef/Code/brlcad/src/libdm/dm-ogl.c:650:5
[ 36% ]
In function ‘ogl_open’
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c: In function ‘ogl_open’:
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:650:5: error: unknown type name ‘XDeviceInfoPtr’
XDeviceInfoPtr olist = NULL, list = NULL;
^~~~~~~~~~~~~~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:650:28: error: initialization makes integer from pointer without a cast [-Wint-conversion]
XDeviceInfoPtr olist = NULL, list = NULL;
^~~~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:650:41: error: initialization makes integer from pointer without a cast [-Wint-conversion]
XDeviceInfoPtr olist = NULL, list = NULL;
^~~~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:651:5: error: unknown type name ‘XDevice’
XDevice *dev = NULL;
^~~~~~~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:652:5: error: unknown type name ‘XEventClass’; did you mean ‘XEvent’?
XEventClass e_class[15];
^~~~~~~~~~~
XEvent
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:653:5: error: unknown type name ‘XInputClassInfo’
XInputClassInfo *cip;
^~~~~~~~~~~~~~~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:891:18: error: ‘XDeviceInfoPtr’ undeclared (first use in this function)
if (list == (XDeviceInfoPtr)NULL ||
^~~~~~~~~~~~~~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:891:18: note: each undeclared identifier is reported only once for each function it appears in
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:892:26: error: expected ‘)’ before numeric constant
list == (XDeviceInfoPtr)1) goto Done;
^
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:895:10: error: invalid type argument of ‘->’ (have ‘int’)
if (list->use == IsXExtensionDevice) {
^~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:895:19: error: ‘IsXExtensionDevice’ undeclared (first use in this function); did you mean ‘LastExtensionError’?
if (list->use == IsXExtensionDevice) {
^~~~~~~~~~~~~~~~~~
LastExtensionError
In file included from /home/naseef/Code/brlcad/include/raytrace.h:58:0,
from /home/naseef/Code/brlcad/include/dm.h:33,
from /home/naseef/Code/brlcad/src/libdm/dm-ogl.c:78:
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:896:27: error: invalid type argument of ‘->’ (have ‘int’)
if (BU_STR_EQUAL(list->name, "dial+buttons")) {
^
/home/naseef/Code/brlcad/include/bu/str.h:123:42: note: in definition of macro ‘BU_STR_EQUAL’
#define BU_STR_EQUAL(s1, s2) (bu_strcmp((s1), (s2)) == 0)
^~
[ 36%] Building C object src/libged/CMakeFiles/libged-obj.dir/brep.c.o
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:897:14: error: implicit declaration of function ‘XOpenDevice’ [-Wimplicit-function-declaration]
if ((dev = XOpenDevice(pubvars->dpy,
^~~~~~~~~~~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:898:16: error: invalid type argument of ‘->’ (have ‘int’)
list->id)) == (XDevice *)NULL) {
^~
[ 36%] Building C object src/librt/CMakeFiles/librt-obj.dir/primitives/eto/eto.c.o
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:898:27: error: ‘XDevice’ undeclared (first use in this function); did you mean ‘ndevices’?
list->id)) == (XDevice *)NULL) {
^~~~~~~
ndevices
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:898:36: error: expected expression before ‘)’ token
list->id)) == (XDevice *)NULL) {
^
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:903:17: error: request for member ‘classes’ in something not a structure or union
for (cip = dev->classes, k = 0; k < dev->num_classes;
^~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:903:26: warning: left-hand operand of comma expression has no effect [-Wunused-value]
for (cip = dev->classes, k = 0; k < dev->num_classes;
^
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:903:42: error: request for member ‘num_classes’ in something not a structure or union
for (cip = dev->classes, k = 0; k < dev->num_classes;
^~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:905:18: error: request for member ‘input_class’ in something not a structure or union
switch (cip->input_class) {
^~
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:928:3: error: implicit declaration of function ‘XSelectExtensionEvent’; did you mean ‘XFreeExtensionList’? [-Wimplicit-function-declaration]
XSelectExtensionEvent(pubvars->dpy, pubvars->win, e_class, nclass);
^~~~~~~~~~~~~~~~~~~~~
XFreeExtensionList
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:934:5: error: implicit declaration of function ‘XFreeDeviceList’; did you mean ‘XFreeStringList’? [-Wimplicit-function-declaration]
XFreeDeviceList(olist);
^~~~~~~~~~~~~~~
XFreeStringList
/home/naseef/Code/brlcad/src/libdm/dm-ogl.c:649:9: warning: unused variable ‘unused’ [-Wunused-variable]
int unused;
^~~~~~
src/libdm/CMakeFiles/libdm-obj.dir/build.make:86: recipe for target 'src/libdm/CMakeFiles/libdm-obj.dir/dm-ogl.c.o' failed
make[2]: [src/libdm/CMakeFiles/libdm-obj.dir/dm-ogl.c.o] Error 1
CMakeFiles/Makefile2:18871: recipe for target 'src/libdm/CMakeFiles/libdm-obj.dir/all' failed
make[1]: [src/libdm/CMakeFiles/libdm-obj.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
ah, there we go
need one more protection
what do you mean?
so the underlying problem is that the code was written to use the XInput API in just a couple places
to use an API, you need libs and you need headers
So I failed to follow the build instructions on wiki?
it detected that you do not have the headers, so the code needs to disable the XInput code
no....
code is constantly changing, you are on the latest code which we change throughout the day nearly every day
I updated just a few hours ago.
yes
because I asked you to, I made a change
did you read the patch, you asked for it
I did
I don't have your setup, I don't have your errors, so I made a change that turned off some XInput code that wasn't getting turned off -- entirely just by reading your error log
it's not something I could test. you're testing it now
Well, How you would handle such error?
there's a different error now because while I turned off one bit of XInput code, there was another less obvious bit that was overlooked
so that bit needs to be turned off too
is the XInput of X11 or DirectX?
i don't understand your question
me neither
heh
I'm working on an additional change, which again I cannot test, but I can certainly make the code edits and we can see what happens
I'll do the testing and reporting.
you can test it, maybe understand how it pertains to the first change
Sure, I'll try to understand
none of this is mysterious magic.. computers just only do exactly what we tell them to do, so when programming it takes time to get things exact. this is how coding goes. (always)
okay, committed
Yeah, We need A.I. powered chips.
I'll update...
svn diff -c70576 to see the change
any plus lines are lines added, any minus lines are lines deleted.
I see
so you'lll see some preprocessor blocks, which is a typical way to "turn off" code at compile-time -- the compiler won't compile code between the #ifdef and #endif blocks unless that HAVE_X11_EXTENSIONS_XINPUT_H symbol is declared, which is tested for and set during cmake
It's compiled past 43%, Which means build succeeded.
Elapsed compilation time: 1 hour 17 minutes 6 seconds
SUCCESS!
Thanks @Sean
(deleted)
the *.g databases are generated by cmake? I want to check that out.
what are the *.asc files?
/home/jeff/Documents/brlcad/src/nirt/parse_fmt.c: In function ‘direct_output’: /home/jeff/Documents/brlcad/src/nirt/parse_fmt.c:655:22: error: ‘popen’ undeclared (first use in this function) (openfunc == popen) ? "'| " : "'", dest_string); ^
Getting this error when trying to build from latest source checkout.
Getting this error when trying to build from latest source checkout.
@Jeff Sieu do you still get this error? it should have been fixed yesterday. one of the devs has been working on strictness compilation, which is tricky cross platform
@Jeff Sieu do you still get this error? it should have been fixed yesterday. one of the devs has been working on strictness compilation, which is tricky cross platform
Yep, I still do.
@Jeff Sieu just applied a few fixes that should fix that one -- would you test again?
@Jeff Sieu just applied a few fixes that should fix that one -- would you test again?
@Sean yup, works now
woo hoo! thanks jeff
Last updated: Jan 10 2025 at 00:48 UTC