VasiliBaranov / packing-generation

Hard-sphere packing generation in C++ with the Lubachevsky–Stillinger, Jodrey–Tory, and force-biased algorithms and packing post-processing.
MIT License
106 stars 43 forks source link

Questions From a Starter with Non-experience #4

Open GuoyiLi1991 opened 7 years ago

GuoyiLi1991 commented 7 years ago

Hi Dr. Baranau,

I am a Ph.D. student and just got a project about sphere modeling. I found your code seems to be the best available source so I downloaded your code package. I am using a Macbook OS system now. I could not compile the file and even don't know what to do after compiling. As you mentioned in the README, I tried to use the terminal getting into the _Debug file. But once I typing 'make', it shows error like below,

error: use of undeclared identifier 'AreEqual' AreEqual(actualValues[i], expectedValues[i], callerName); error: no matching function for call to 'AreEqual' AreEqual(actualValues[i], expectedValues[i], callerName); error: no matching function for call to 'AreEqual' AreEqual(actualValues[i], expectedValues[i], callerName);

and I also tried to use the terminal getting into the _Release file. But once I typing 'make', it shows error like below,

make: Nothing to be done for `Tests/Source/Assert.d'

Can you please let me know what I should do? It is because of the Mac system or something wrong in my procedure? I check others' issue, seems other people can easily use it. I am not familiar with such advance programming. Sorry for bothering you so much. Thank you!

Sincerely Guoyi Li

wandadars commented 7 years ago

Hi Guoyi,

I tried to compile it on Mac OSX Yosemite, and I get the same errors. I tried to manually fix them, but every issue that I fixed was just followed by another issue. Maybe the makefiles aren't being parsed correctly & producing issues when dependencies are not being loaded correctly. I'm not sure. I cloned the repo to a linux machine running OpenSuse 13.2. I typed 'make' and the code compiled without any issues.

You have to do a 'make clean' when you get an error when compiling on Mac, otherwise it just bugs out and thinks it's done for some reason.

For you, I would suggest looking into either setting up a linux partition on your hard disk using Apple's Bootcamp. It would probably be easier to do that than to port the code to make it compatible with the Mac build environment.

You may need to update the version of the gcc compiler that the Mac has. I used 'Homebrew' for managing software version on the mac.

https://apple.stackexchange.com/questions/38222/how-do-i-install-gcc-via-homebrew

GuoyiLi1991 commented 7 years ago

Hi Dr. Baranau,

Thank you so much for the quick reply and every effort you made to address my issues. I will try to compile it on a Linux computer. Thank you again for your thoughtful reply!

Sincerely, Guoyi

wandadars commented 7 years ago

Just for clarity. I'm not Dr. Baranau. Just a user who follows this repository. Don't want him to think I'm pretending to be him haha.

GuoyiLi1991 commented 7 years ago

Oh, I am so sorry! Thank you!

GuoyiLi1991 commented 7 years ago

Hi Wandadars,

I just used my colleague's computer with Red Hat Linux. It still shows the error...

make: Nothing to be done for `Tests/Source/Assert.d'

Thanks, Guoyi

wandadars commented 7 years ago

Hey Guoyi,

That isn't an error. The make utility just thinks that it has compiled the code without issue. Do a 'make clean' and try to use 'make' again. If you copied the directory over to the other machine, do the 'make clean' on your machine first before copying. Sometimes copying the *.d files confuses the clean utility and it doesn't clear them out.

VasiliBaranov commented 7 years ago

Hi Guoyi,

what @wandadars wrote is absolutely right (thank you so much for the replies, @wandadars !). I hope you managed to compile it on Linux.

Apparently, compilation on Mac does not work and I have to fix it at some point. The errors stem from the fact that I tried to write some basic unit tests without depending on any unit-testing framework and added some makefile instructions and preprocessor directives to distinguish between compiling the actual program and compiling the tests for the program. It seems that the setup shall be more advanced to make the compilers on MacOS compile everything correctly (at least, as i wanted).

If you want a quick and dirty solution for the MacOS compilation, you can download the Eclipse CDT IDE, import the PackingGeneration project, then delete the folder "Tests" completely (it contains files that screw up the compilation), then right-click on the project (in the project explorer) and click "clean project", then rebuild the "_Release" version (Eclipse CDT will regenerate makefiles and these Tests will not interfere anymore). Then, you can use the updated makefiles in the _Release folder. If it takes too much time, please contact me, i will apply this quick and dirty solution by myself and send you the updated version of akefiles. A complete solution will probably take some time for me.

Best Regards, Vasili

GuoyiLi1991 commented 7 years ago

Hi Dr. Baranau,

First of all, I would like to thank you and @wandadars so much for the thoughtful help. I am still working on this project, however, I could not get a Linux PC till now. In order to avoid bothering you too much, I tried to follow the step you taught me. But I was unable to rebuild the '_Release'. I am wonderings if you could kindly give me some further guidance or send the updated version to me. I am so sorry for taking your time. I am attaching the error message for your reference.

screen shot 2017-07-20 at 11 51 10 am

Best Regards, Guoyi Li

VasiliBaranov commented 7 years ago

Hi Guoyi Li!

Then may be the easiest way will be the following. Please do the following:

  1. open the _Release/makefile and remove the line 11, "-include Tests/Source/subdir.mk"
  2. open the _Release/sources.mk and remove the line 26, "Tests/Source \"

Then try to run the make utility in the _Release folder again. Here are the two updated files for convenience.

This essentially just removes any test files from compilation (without bothering with Eclipse).

Hope this helps!

Best, Vasili

GuoyiLi1991 commented 7 years ago

Hi Dr. Baranau,

Thank you so much for your guidance. I will try this way and discuss with you regarding further things if I meet.

Thanks again, Guoyi

anufagbemi commented 7 years ago

Hi guys thanks for the comments. I'm trying to run the makefiles on linux(ubuntu), after the .exe has been generated, I keep getting this error that "An error occurred while loading the archive." Please what could be the reason for that. Thanks

wandadars commented 7 years ago

I notice that there is a common issue of compilation. This weekend I'm going to try to generate a Docker image of the compiled code, so that anyone can run the code on any operating system without having to compile it.

VasiliBaranov commented 6 years ago

Hi @anufagbemi, this link suggests that you were probably trying to

VasiliBaranov commented 6 years ago

Sorry, I wanted to say that I do not know the reason, the only explanation that comes to mind is that you are somehow trying to run on ubuntu the executable that was compiled on windows, but you explicitly say that it was produced by makefiles on Ubuntu as well.. I think there still might be problems if it is compiled on different Linux distributions.. Could you maybe try to compile it on exactly the same machine or at least linux ditribution where you try to run it (if it is not the case). Otherwise, could you please maybe provide more details?

VasiliBaranov commented 6 years ago

Hi @wandadars, it would be great if you could do that (the docker image)! It is a great idea, I would be very grateful! Best, Vasili

ahmedgamal58 commented 6 years ago

Hi dr i start project packing sphere on VS 2017 but give this erore

'PackingGeneration.exe' (Win32): Loaded 'C:\Users\ahmedgamal57\Desktop\New folder (8)\packing-generation-1.0.1.28\Debug\PackingGeneration.exe'. Symbols loaded. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll' 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file. 'PackingGeneration.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file. The thread 0x2ebc has exited with code 0 (0x0). The thread 0x460 has exited with code 0 (0x0). The program '[3564] PackingGeneration.exe' has exited with code 0 (0x0).

i delete test file but same erore

VasiliBaranov commented 6 years ago

Hi ahmedgamal58,

sorry for a long delay! If it's still relevant, code 0 means that the program exited correctly. I googled the message and stackoverlfow has a lot of questions (and an answer) about such messages. This is the most popular link: https://stackoverflow.com/questions/12954821/cannot-find-or-open-the-pdb-file-in-visual-studio-c-2010 (but there are others). The most popular answers seem to be (for VS 2010 and 2013, but presumably VS 2017 has smth like this as well): Go to Tools->Options->Debugging->Symbols->Microsoft Symbol Servers->On Go to Tools -> Options -> Debugging -> Output Window -> Module Load Messages -> Off

Hope this helps!

Best, Vasili

ahmedgamal58 commented 5 years ago

now give me error link2019