How can one compile Coq code reliably using `coqc` command? - coq

I was going the the software foundations course and for some reason I could NOT get the coqc command to compile my libraries.
I did:
coqc Maps.v
but get the error:
Error: The file /Users/pinocchio/coq/software_foundations_vol1/Maps.vo
contains library maps and not library Maps
I also tried compiling with coqIDE but I get the following error:
Error: Compiled library Maps (in file
/Users/pinocchio/coq/software_foundations_vol1/Maps.vo) makes
inconsistent assumptions over library Coq.Init.Notations
Any ideas on what can I do?

Related

Converting Modelica models from Dymola to JModelica - Addressing Errors in Log File

I am currently trying to compile the netCDF-DataReader in JModelica but it appears the package has been developed in Dymola. The process fails at the compilation stage:
netCD = compile_fmu('NcDataReader2.Examples.Simple',r'H:\Modelica\Modelica Libraries\NcDataReader2',compiler_log_level= 'w,i:log.txt')
CcodeCompilationError: Compilation of generated C code failed.
The log file created contains 326 lines. Midway it says
====== Model compiled successfully =======
But there are many errors after. Some of the errors include:
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" '
unrecognized collect2.exe: error: ld returned 1 exit status
mingw32-make1: *** [ceval_] Error 1 Cannot export
??_C#_01LFCBOECM#?4?$AA#: symbol not found Cannot export
??_C#_01NOFIACDB#w?$AA#: symbol not found
C:\JModelica.org-2.1\install\Makefiles\MakeFile:190: recipe for target
'fmume10' failed
I don't have much experience with compilers and debugging C-code and would prefer to spend my time focused on creating models; therefore this leads to a number of questions:
Are there patterns in this errror log that could be addressed in such a way to make Dymola libraries useable in other Modelica based programs, such as JModelica?
Are then any other compilers that may be more suited to cross-compatible models?
Am I wasting my time trying to make Dymola models run in JModelica? Would it be more sensible to recreate the model separately in JModelica? The lack of a front-end interface makes this tricky.
The problem is that the external libraries available in netCDF-DataReader needs to be compiled using the GCC compiler available in the JModelica distribution. Try to recompile the libraries using GCC and put the libraries in NcDataReader2\Resources\Library\win32 (or even better put them in NcDataReader2\Resources\Library\win32\gcc472)

Coq error: The reference evenb was not found in the current environment

I'm trying to go through the Software Foundations Coq book (http://www.cis.upenn.edu/~bcpierce/sf/current/toc.html), but when I compile Induction.v (which looks like http://www.cs.uml.edu/~rhenniga/coq/sf_induction.html), I get the error message "Error: The reference evenb was not found in the current environment." -- even after compilation of Basics.v. Any ideas why?
I can confirm that opening CoqIDE from the same directory works on macOS: cd <sf-dir>; /Applications/CoqIDE_8.5.app/Contents/MacOS/coqide
from: The reference "X" was not found in the current environment
Try to erase every blank character in the address related to Coq or software-foundation book.
In my case, when I struggled with the file
C:\Users\XxX\Documents\software foundation\lf\Induction.v
, CoqIDE failed to execute From LF Require Export Basics and to define evenb_S theorem. Also, I couldn't see any files like Basics.vo or Basics.glob created when Basics.v with [Compile] - [Compile buffer] function in CoqIDE.
Everything works fine when I change my folder name to
C:\Users\XxX\Documents\softwarefoundation\lf\Basic.v
The Coq installer had already informed this >>
Link to the screenshot image of Coq setup
Compiling Basic.v with coqc Basics.v command should produce Basic.vo and Basic.glob files in the same directory. Then you should be fine with compiling Induction.v in the same directory as well; coqc Induction.v.

coq Error: Cannot find library abstract_algebra in loadpath

I am testing one of the contrib libraries of coq called corn: https://github.com/c-corn/corn
But I can't get the files to pass compilation. According to the README file, the package compiles with coq-8.4pl4. But when I tested that version, I got an error message:
...
coqc algebra\RSetoid -R . CoRN
File "d:\temp\corn/algebra\RSetoid.v", line 26, characters 0-32:
Error: Cannot find library abstract_algebra in loadpath
I also tried the latest 8.4 version (8.4pl6) and 8.5 beta 2, and got similar errors. The problem line itself reads:
Require Import abstract_algebra.
I am not familiar with this library (abstract_algebra). Does anyone know about this library, where to get it, or how to fix this error?
(I googled around the error message, and there was no mention of the abstract_algebra library).
Thanks in advance.

Raspberry PI cross compilation linking error - unknown symbol _dl_hwcap

I have successfully set up a cross-complation environment for my RPI under 64 Bit ubuntu. I can compile and run a personal project using gstreamer just fine.
Due to performance-issues with gstreamer, I want to work on a fork of omxplayer. I adapted it to my environment, and compilation of ffmpeg and omxplayer themselves work just fine.
However, linking an actual executable (ffmpeg, or omxplayer.bin) yields a linking error I have been unable to resolve.
You find the full output of the last failing linking-step with verbose flags here:
https://gist.github.com/deets/3bba7c94017405d28f81
The error message is
ffmpeg_compiled/usr/local/lib/libavcodec.so: undefined reference to `_dl_hwcap'
collect2: error: ld returned 1 exit status
The missing symbol to me suggests something with dynamic loading. Maybe the libc or libdl are botched? But how come these are working just fine if compiling another project?
Found the culprit. When setting up the crosscompilation-environment, make sure your copy of the RPI's libraries are correct. I had unresolved symbolic library links that needed fixing in my rsync'ed copy of the RPI's file-system.

Issues with g++ and Eclipse on Linux - unresolved symbols

I am running Ubuntu 64bit version, and downloaded the latest 64bit Eclipse.
Installed g++ along with build-essential. Tested g++ to make sure it works from terminal, and it works fine.
alex#ubuntu:~/Desktop$ g++ test.cpp -o test
alex#ubuntu:~/Desktop$ ./test
Hello World!alex#ubuntu:~/Desktop$
However, trying to build simple C++ Hello Word project(one of the default projects that comes with Eclipse), I am getting error.
Description Resource Path Location Type
Program "g++" not found in PATH Preferences, C++/Build/Settings/Discovery, [CDT GCC Builtin Compiler Settings] options C/C++ Scanner Discovery Problem
I have added Environment variable named g++ with value /usr/bin/g++ and the above error went away, however, now I am getting unresolved errors, though project compiles and in the Console shows !!!Hello World!!!
Description Resource Path Location Type
Symbol 'endl' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'cout' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'std' could not be resolved test_hello.cpp /test_hello/src line 10 Semantic Error
Have I correctly entered Environmental variable ?? How can I get fix the "unresolved" error ?? Thanks !
When compiling there are two important things to consider:
1.) Is my path up-to-date with executables?
2.) Is my library path correct?
It appears you satisfy 1.) but not 2.)
The unresolved symbol error means that Eclipse cannot find your library via LD_LIBRARY_PATH or some other medium. It's attempting to locate the standard compiled C++ library.
How did you install g++?
Kindly do this and post the results:
Project > Properties > C/C++ Build > Environment
If everything there appears nominal, you can try
/sbin/ldconfig
which should hopefully re-parse your system library paths and might update your environment.