Using Z3 with python in Visual studio 2013 - z3

I installed the Python 2.7.10 64 bit. I downloaded the latest Z3 sources from https://github.com/Z3Prover/z3. I copied the folder z3-master in the Python27 folder. Then, I opened the Visual Studio 2013 command prompt and build the z3 using instructions provided on the same github page. Build was successful. I added the 'PHYTHONPATH c:\Python27\z3-master\build\z3lib.dll'. Now, when I run any example from visual studio python, it give me an error on the first line, i.e.,
from z3 import * : The error is 'no module named z3'
If I run the example from python shell, it give error
"init(Z3_LIBRARY_PATH) must be invoked before using z3-python"
I don't see any bin folder inside z3-master or in the build folder.
How to use Z3py from within visual studio?
Thanks

I have used the instructions given on the following link:
Using Z3Py With Python 3.3
Actually, only the last two instructions (comment) worked for me. That's instructions are as follow:
**Another option is to use the precompiled DLL in the nightly builds for Windows 64-bit. This link has additional information: research.microsoft.com/en-us/um/people/leonardo/blog/2013/02/15/… – Leonardo de Moura Mar 25 '13 at 23:35
Thanks - Now I'm using my self-compiled unstable build with the libz3.dll file replaced by the one from the nightly channel and I didn't encounter any problems so far. – fdj815**
So, I simply went to the link, clicked on the "Nightly builds of Z3". Then click on the "Go to the Z3 Downloads page". Then, I downloaded the 64 bit pre-compiled zip file. Unzip it and added the path of bin folder to both 'PATH' & 'PYTHONPATH' environment variables. But in the Visual studio Python project, I still had to add 'PYTHONPATH' in the search paths of the project. It seems it doesn't automatically look into these environment variables.
Link to the nightly builds is:
http://leodemoura.github.io/blog.html

Related

sonar-swift to analyse xcode project

Im trying to analyse swift app using SonarQube. followed the instructions from here
Im able to run the sonarqube server and running sonar-scanner while running it I'm getting this error
com.sonarsource.A.A.B.A: No license for swift
I'm using this plug in, backelite-sonar-swift-plugin-0.2.4.jar i feel this plug in is free and we can use it. correct me it I'm wrong.
What I did was:
Download Sonarqube LTS version (https://www.sonarqube.org/downloads/)
Download and install dependencies and Sonar-Swift from https://github.com/Backelite/sonar-swift (including sonar-scanner)
Download sonar-project.properties (https://gist.github.com/Edudjr/db51907068ea76b116d11d9a9b13f05f#file-sonar-project-properties) and configure it according to your project. Place it in your project root folder.
Download run-sonar-swift.sh (https://gist.github.com/Edudjr/79a2379842357c33709aecf040d9ae77#file-run-sonar-swift-sh), place it in somewhere in your mac and add to path (/etc/paths). I did a small change in the script because oclint was not running properly.
Start your Sonarqube server (sonar.sh console in sonar folder) and run run-sonar-swift.sh in your project root folder. You should be done.
Manual Installation
In the page dedicated to the plugin you want to install (ex: for Python : SonarPython), click on the "Download" link of the version compatible with your SonarQube version.
Upload the downloaded jar file in your SonarQube Server and put it in the directory : $SONARQUBE_HOME/extensions/plugins.
If another version of the same plugin is already there, you need to remove it, since only one version of a given plugin may be available in the extensions/plugins directory.
Once done, you will need to restart your SonarQube Server.
https://docs.sonarqube.org/display/SONAR/Installing+a+Plugin
Backelite Sonar-Swift last release:
https://github.com/Backelite/sonar-swift/releases

MathNet Numerics needs FsUnit.CustomMatchers to successfully build. Ran out of options

In trying to build the latest version of MathNet Numerics from GitHub using Visual Studio Community 15 with MathNet.Numerics.sln which needs DLLs for unit testing installed.
Could not resolve this reference. Could not locate the assembly "FsUnit.CustomMatchers".
Could not resolve this reference. Could not locate the assembly "FsUnit.NUnit".
Could not resolve this reference. Could not locate the assembly "nunit.framework".
So using NuGet from within Visual Studio the following can be successfully installed.
Successfully installed 'NUnitTestAdapter.WithFramework 2.0.0' to UnitTests
Successfully installed 'FSharp.Core 3.1.2.5' to FSharpUnitTests
Successfully installed 'NUnit 3.0.1' to FSharpUnitTests
Successfully installed 'FsUnit 2.0.0' to FSharpUnitTests
The only DLL remaining is
FsUnit.CustomMatchers
which I am unable to locate.
The hint is ..\..\packages\test\FsUnit\lib\FsUnit.CustomMatchers.dll, yet there is not test directory under packages.
How do I correctly resolve this?
Do I need the DLL and if so where can it be located?
Do I need to make a manual code fix?
Do I need to update the hint?
TLDR;
If I build without the missing DLL the basic error is:
A unique overload for method 'IsTrue' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates:
Assert.IsTrue(condition: Nullable<bool>, message: string, [<ParamArray>] args: obj []) : unit,
Assert.IsTrue(condition: bool, message: string, [<ParamArray>] args: obj []) : unit
which can be resolved by installing
Microsoft.VisualStudio.QualityTools.UnitTestFramework
and adding
open Microsoft.VisualStudio.TestTools.UnitTesting
which has the signature of
Assert.IsTrue(condition: bool, message: string, [<ParamArray>] args: obj []) : unit
but that is not correct as it does not install the correct DLL (Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll vs FsUnit.CustomMatchers) and from past experience with F# Unit testing I am aware of the subtitles that could allow false positives by doing such.
EDIT:
After successfully installing I wanted to know where this was documented.
See: Building Math.NET Numerics
The fully automated build including unit tests, documentation and
api reference, NuGet and Zip packages is using FAKE.
That solution is using Paket, the F# package system. Not NuGet. It also uses FAKE, the F# build system.
To have everything restored, configured and built, simply run build.cmd (or build.sh if you're on *NIX).
The /test/ part of the path comes from something called "dependency group", a feature of Paket. In a nutshell, it lets you group your dependencies by some criteria, and then restore them selectively rather than "all dependencies, all the time".
This particular project, judging by its paket.dependencies file, defines four groups - Test, Build, Data, and Benchmark. I can guess that "Build" has dependencies needed for regular build, and "Test" has dependencies needed for testing.
To restore dependencies using Paket, you need to download Paket and then run paket install.
In order to streamline the downloading part, the solution includes a bootstrapper at .paket/paket.bootstrapper.exe, which you can run to have the latest Paket downloaded. This is a standard thing, it is added when you initialize a new project by running paket init.
And the whole process (i.e. running the bootstrapper and then running Paket itself) is encoded in build.cmd and build.sh files, along with running FAKE afterwards. This is why I suggested that you simply run build.cmd.

MSBuild not copying files with PublishProfile

I have a Visual Studio 2013 solution with the full Orchard source code. When I use "Publish..." on the "Orchard.Web" project in Visual Studio, it correctly publishes the site to the File System destination I've configured into the .PubXml file that I used.
However, if I build this site using Jenkins, the files do not get copied to the destination. I've created a separate PubXml file that is used by Jenkins.
In my Jenkins job, I have two Build steps of interest. The first uses the src\Orchard.sln file with a command line argument of /p:Configuration=Release. This runs correctly, and builds the entire solution.
The second Build step, immediately after, uses the Build File of src\Orchard.Web\Orchard.Web.csproj and these command line arguments:
/p:DeployOnBuild=true
/p:PublishProfile="D:\workspace\Site\trunk\src\Orchard.Web\Properties\PublishProfiles\Jenkins.pubxml"
/p:VisualStudioVersion=12.0
/p:Configuration=Release
/p:Platform=AnyCPU
/v:minimal
/nologo
/p:WarningLevel=1
With this, the build and deploy seems to work - but doesn't. Here are some lines from the build output:
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Auto ConnectionString Transformed obj\Release\Package\PackageTmp\Shapes\Scripts\Web.config into obj\Release\CSAutoParameterize\transformed\Shapes\Scripts\Web.config.
(... about 200 more "Auto ConnectionString..." lines...)
Finished: SUCCESS
No where does it actually copy the files to the destination defined in the PUBXML file.
In contrast, in Visual Studio, the output looks similar, but transforms only 4 config files and includes lots of "Publishing folder x" lines:
(...)
Transformed Modules\SH.GoogleAnalytics\web.config using ....
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Publishing folder /...
Publishing folder bin...
(etc.)
(I have installed the latest Windows Azure SDK for .NET on the Jenkins server.)
I have the same trouble,that work for me:
/t:Rebuild
/p:DeployOnBuild=true
/p:PublishProfile=Jenkins_Publish
/p:Configuration=Release
do not use /p:VisualStudioVersion=xxx
This is kind of old, but I actually just set up Orchard to be able to get built via command line and MSBuild. Here is what I did:
/p:VisualStudioVersion=12.0;PublishProfile="example-profile";DeployProjA=true;FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v4.5";Configuration=Release;PublishProfileRootFolder=c:\Workspace\src\Orchard.Web\Properties\PublishProfiles;Password=ExamplePass
Since you are using Orchard you want to make sure that only the Orchard.Web project gets published so do not use DeployOnBuild=true. This will attempt to deploy every web project in the solution, which is a lot for Orchard. Instead follow the guidelines here to see how to deploy only the web project: http://sedodream.com/2013/03/06/HowToPublishOneWebProjectFromASolution.aspx

Can't run DynaForm - BUILD FAILED - Ant

To run the sample application of DynaForm (a dynamic web form generator) I followed the readme instruction:
DynaForm - a dynamic web form genrator
To run the sample application use your command line and type "ant".
Then open localhost:2000/ on your browser.
The build script requires ANT and JDK (at least Java 1.6) to be in the path.
The DynaForm's project site is hostet at:
http://code.google.com/p/xsd-web-forms/
Rein Raudjärv
May 23 2010
In my Mac I have ANT and JDK (with Java 1.6). When launch in my command line "ant" I have this error:
BUILD FAILED
/Users/colet/Desktop/dynaform/build.xml:64: /Users/colet/Desktop/dynaform/${env.ANT_HOME}/lib does not exist.
Maybe I misunderstood the sentence:
The build script requires ANT and JDK (at least Java 1.6) to be in the path.
what does "to be in the path" mean?
Thanks!
Please clone the DynaForm project from GitHub instead of Google Code:
https://github.com/reinra/dynaform
The newer version builds via Maven instead of Ant, so it's simpler and should work better.
Check that you have defined ANT_HOME environment variable correctly. Refer to Ant installation instructions, if needed.

NuGet Package Restore is not restoring packages on build

I am moving our source code from Vault to TFS, not bothering with the migration or anything, just pulling a get latest in vault and adding it to TFS.
The solution has got several projects, and each one has at least one NuGet package. I am trying to get Package Restore working again. It worked in Vault (but not the way it was supposed to). I was under a bit of a deadline, and it did not work at first, so I added a Pre-Build event to run nuget.exe against the packages.config for each project.
TFS build service complains about that, so I am trying to get it working "right".
I have set the option in Visual Studio Tools menu.
I have installed NuGetEnablePackageRestore and run the fix.
I have verified that the packages directory is is source control, but is empty.
I have verified that the project files each include the following:
<RestorePackages>true</RestorePackages>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Building with Diagnostic level verbosity reveals that each project evaluates those properties, but the RestoreCommand in nuget.targets is never executed.
Any thoughts?
I have attempted to implement the solutions from these links:
nuget - package restore not working
NuGet Package Restore Not Working - I did post a question/comment on there asking for clarification...
http://nuget.codeplex.com/workitem/1879
Edit
Additionally, I have found that the RestoreCommand property is being evaluated during build. Diagnostic Verbosity shows:
RestoreCommand = (set EnableNuGetPackageRestore=true) && "C:\Source\Kiersted Direct And Related\Direct\Kiersted\.nuget\nuget.exe" install "packages.config" -source "#(PackageSource)" -o "C:\Source\Kiersted Direct And Related\Direct\Kiersted\packages"
I figured it out, and I found the answer here: MSBuild not running BuildDependsOn tasks from an imported project
The problem (after looking through the Diagnostic verbosity build output) was that the BuildDependsOn setting was getting un-set. My project files each had the import statement
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
but that statement was at the beginning of the XML tree. Apparently the import for Microsoft.CSharp.targets can interfere with that import and thus the BuildDependsOn.
My solution was to move the nuget.targets import to below the Microsoft.CSharp.targets import. Now everything builds beautifully.
This answer needs to be considered with the others. In my case, Visual Studio decided not to add the packages.config automatically into Source Control. Hence the file did not make it's way through to the build server for consideration during Nuget restore.

Resources