Debugging a JLink application in Creo 2.0 - jlink

I am trying to use J-Link, the Java language toolkit for Pro-Engineer.
I get some knowledge from the API that provided by PTC.I need some tutorial or help file for model check.Please guide me to make better.
Any other suggestions/recommendations?

Have you checked the user guide in the ProE installation folder (\Common Files\jlinkug.pdf)?
Demo applications are in the "jlink_tutorial" and "jlink_appls" folder
Model model = curSession.GetCurrentModel();
ModelCheckInstructions checkInstr = pfcModelCheck.ModelCheckInstructions_Create();
checkInstr.SetMode(ModelCheckMode.MODELCHECK_NO_GRAPHICS);
checkInstr.SetShowInBrowser(true);
checkInstr.SetConfigDir(null);
checkInstr.SetOutputDir(null);
ModelCheckResults modelCheckResults = curSession.ExecuteModelCheck(model, checkInstr);
int numberOfErrors = modelCheckResults.GetNumberOfErrors();
int numberOfWarnings = modelCheckResults.GetNumberOfWarnings();

Related

"HV000183 - EL dependencies not found" using hibernate-validator 7.0.0.Final / jakarta.el 4.0.1

I've a kotlin spring boot project with org.hibernate:hibernate-validator:7.0.0.Final and org.glassfish:jakarta.el:4.0.1.
For testing validation constraints I create a javax.validation.Validator, like so:
val factory = Validation.buildDefaultValidatorFactory()
validator = factory.validator
This results in the following error: HV000183: Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath, or use ParameterMessageInterpolator instead. Which I find strange, since I included them per the instructions: https://hibernate.org/validator/documentation/getting-started/
If I combine org.hibernate:hibernate-validator:7.0.0.Final and org.glassfish:javax.el:3.0.0 it works, but it looks like 7.0.0.Final should not be used with javax.el, but with jakarta.el, without me knowing the reason why at the moment: https://in.relation.to/2021/01/06/hibernate-validator-700-62-final-released/
Any ideas on what I need to do to use hibernate-validator v7?

GlyphVector.getoutline() never returning

I am trying to create a PostScript file using the Apache xml-graphics library. When I run under Java, it works fine.
But when I build for .NET using IKVM, then on a call to GlyphVector.getoutline(x, y), the code never returns.
This is happening when I:
AttributedString as = new AttributedString(buf.toString());
// call as.addAttribute() setting various TextAttribute for various ranges
FontRenderContext frc = graphics.getFontRenderContext();
LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(as.getIterator(), frc);
TextLayout layout = lineMeasurer.nextLayout(Integer.MAX_VALUE);
layout.draw (graphics, left, line.getBaseline());
Any idea what can be going wrong?
thanks - dave

How can i fine-tune qt5 for an embedded system?

I am using yocto, and already have a build of qt5 in my image and it works. The issue is that it is HUGE.
So, I tried to use a .bbappend recipe in my layer for qt where I experimented with using
PACKAGECONFIG_remove = " qtnetworking qtdeclarative sql-mysql qtscript...etc";
and
EXTRA_OECONF = " -no-accessibility -no-feature-MDIAREA -no-feature-DRAGANDDROP ...etc";
I even removed all the feature disablement config params in EXTRA_OECONF and just added -qconfig minimal or -qconfig medium.
====> the result is always the same: compilation failure in the qt corelib or qtwidgets.
I want to disable networking, printing, and mdi support. How can I do that?
Much appreciated!

How to use QT and GNU Autotools by using AutoTroll?

I would like to use Autotools and QT4 together. For this i would like to use AutoTroll.
As the Website says, it should be very easy to use it. Unfortunately i was not able to do so.
I have a working Hello World example:
This is how my configure.ac looks like:
AC_INIT([Hello], [0.1], [bug-report#hello.example.com], [hello], [http://hello.example.com/])
AC_PREREQ([2.59])
AM_INIT_AUTOMAKE([1.10 no-define foreign])
AC_PROG_CXX
AC_PROG_CC
AT_WITH_QT
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
My Makefile.am:
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
bin_PROGRAMS = hello
hello_SOURCES = src/*.cpp
My simple main.cpp with a QT include:
#include <iostream>
#include <QApplication> \\Added this to test if Autotools works correctly
int main()
{
std::cout << "Hello Worlasdasdsadd!" << std::endl;
return 0;
}
Can someone please help mit with this? An short Step by step would be very nice.
Thank you in advance.
Edit:
I don't know how to integrate this m4 makro (Autotroll) in my configuration. This is why i cannot provide any "Errors" or something else. The of the website does not help me to understand what to do.
I won't recommend you to mix QT and autotools. For QT projects is most recommended to use cmake/qmake. When you get any problems it would be easier to find answers, etc.
Furthermore, Autotroll seems unmaintained since 2008 and not tested with QT >= 4.4+, and it has rained a lot (really a lot, QML and QT 5.0 as examples) since then:
AutoTroll has been tested successfully with Qt 4.0+, Qt 4.1+, Qt 4.2+ and Qt 4.3+
If you just want to learn autotools, gtk/gnome, gnu-tools or just any c++/c/whatever-language project would make it easier for you. Find projects using autotools and learn what they need and what they use.
Another recommendation is that you look for presentations and talks explaining the autotools basis and tools flows.
All I can say is that Autotools is a big world, be patient.

How to register a new LLVM backend?

I'm developing a very basic new LLVM backend for a RISC machine (named Risco), based on the existing Sparc backend and this tutorial. To register the backend, I've used the following.
At RiscoTargetMachine.cpp:
extern "C" void LLVMInitializeRiscoTarget()
{
// Register the target.
RegisterTargetMachine<RiscoSimulatorTargetMachine> X(TheRiscoTarget);
RegisterAsmInfo<RiscoMCAsmInfo> Y(TheRiscoTarget);
}
At Risco.td:
def : Processor<"simulator", NoItineraries, [FeatureA]>;
def Risco : Target {
// Pull in Instruction Info:
let InstructionSet = RiscoInstrInfo;
}
At TargetInfo/RiscoTargetInfo.cpp:
Target llvm::TheRiscoTarget;
extern "C" void LLVMInitializeRiscoTargetInfo() {
RegisterTarget<> X(TheRiscoTarget, "risco", "Risco");
}
At the top level LLVM configure script:
# Added Risco to the TARGETS_TO_BUILD variable at line 4965 (from svn trunk):
all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend CppBackend MBlaze PTX Risco" ;;
After build, llc -version doesn't show the new target. Even llc -march=risco test.ll says it's an invalid target. What am I missing?
PS: Currently, I'm including the new target as a folder inside llvm/lib/Target. How can I change that so I can build the target separately, and load it dynamic with llc -load?
The default first template parameter for RegisterTarget is Triple::InvalidArch. Try this:
extern "C" void LLVMInitializeRiscoTargetInfo() {
RegisterTarget<Triple::UnknownArch> X(TheRiscoTarget, "risco", "Risco");
}
You might also need to register an assembly printer for your backend in RiscoAsmPrinter.cpp:
extern "C" void LLVMInitializeRiscoAsmPrinter() {
RegisterAsmPrinter<RiscoAsmPrinter> X(TheRiscoTarget);
}
I'm not quite sure what you mean by the last bit. My Makefile has LOADABLE_MODULE=1 and builds the target as a shared object in the lib folder. In order to see the Risco target in the list of registered targets, I would run something like ./bin/llc -load ./lib/libLLVMRisco.so -version assuming you are on Linux.
You have to edit at least 16 files in the root directory of LLVM:
1) In CMakeLists.txt add our target to: set(LLVM_ALL_TARGETS AArch64 ARM ... )
2) Add your target to Triple.h
3) Add HI/LO to llvm_root_dir/include/llvm/MC/MCExpr.h
...
16) ...
The complete steps can be found in LLVMCookbook. Page 228 to 238. Sorry I could not copy/paste 10 pages of tutorial here.
After editing all those 16 files, then build the LLVM using cmake: $cmake ~/llvm/src/ -DLLVM_TARGETS_TO_BUILD=YourTargetName and then $make
If you are lucky enough then your build will be successful, and you can see your target added to llc tools by issuing: $llc –version

Resources