1

for pset5 I employed the wonderful CMPH Library http://cmph.sourceforge.net/ to create a perfect minimal hash. I've finished the project and it runs in a stunning 0.14 seconds, but, now I'm faced with a daunting task. How do I submit the pset in a way that the cs50 checker will have access to this external library? Am I just fracked?

I found this similar post: PSET6 Auto Grader where one person replied it wasn't supported, and suggested not using an external library. However, I'll commit seppuku before I change my code anymore because I already spent forever on this. I regard it as a cruel joke that the staff suggested "researching the web" without also noting that "you cannot use anything you find, however".

Please help!

Edit1: Inspired by @CliffB response I'll clarify a bit. I need to include an entire CMPH library which I 'installed' on my system. So, I tried taking all files I found in the installed directories /usr/local/bin, /include and /lib and putting them into the same directory as dictionary.c and used this command:

check50 2014.fall.pset5.speller dictionary.c dictionary.h Makefile libcmph.la libcmph.a chd_ph.h cmph.h cmph_time.h cmph_types.h cmph libcmph.so.0.0.0

This returns an error 'Uploading... E_UNKNOWN error.'. However, if I leave off that final file 'libcmph.so.0.0.0' then I get the familiar error indicating it can't find the cmph library:

check50 2014.fall.pset5.speller dictionary.c dictionary.h Makefile libcmph.la libcmph.a chd_ph.h cmph.h cmph_time.h cmph_types.h cmph

:) dictionary.c, dictionary.h, Makefile exist :( speller compiles \ expected output, not standard error of "dictionary.c:14:10: error: 'cmph.h' fil...

Sorry, I expected there would be a standard way to 'include' needed C libraries when sending C code elsewhere. I can't find any info on how to deploy C code with needed libraries. How do people share C code that uses non-standard libraries? Do they?

1
  • Did you solve your problem? I coded my trie in a separate trie.c and trie.h file and am facing a similar issue. I can get the check50 to work but when I submitted it was graded 0. Mind you I didn't include the executable when I submitted... But i was just following the instructions "You may add functions to dictionary.c or to files of your own creation so long as all of your code compiles via make" – Chris Dec 17 '15 at 22:50
1

I may be wrong, but it seems to me that if you zip all the files together in the directory that you built the executable, including the modified make file, and then upload, it should work. If not, you can always resubmit a working solution later.

As a test, look at the command used to run check50 locally:

check50 2014.fall.pset5.speller dictionary.c dictionary.h Makefile

It appears that if you add the filenames of any additional files needed for the build to the command, following Makefile, it will upload them to the check50 server and run the test. Give it a try and see if it works. Worst thing that could happen is that it doesn't.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

2
  • Hrmm... thanks for the suggestion, but I'm feeling a bit outclassed. I need to include an entire CMPH library which I 'installed' on my system. So, I tried your suggestion by taking all files I found in the installed directories /usr/local/bin, /include and /lib and putting them into the same directory as dictionary.c and used this command: check50 2014.fall.pset5.speller dictionary.c dictionary.h Makefile libcmph.la libcmph.a chd_ph.h cmph.h cmph_time.h cmph_types.h cmph libcmph.so.0.0.0 – Alexander Grey Krause Dec 6 '15 at 19:07
  • well, it was worth a try. – Cliff B Dec 6 '15 at 19:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .