473,800 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Embedding native code in a .NET DLL


I would like to embed a high-performance native-code BLAS implementation in
a .NET DLL. What is the recommended way of doing this?

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #1
6 2539
On Apr 28, 8:49*am, Jon Harrop <j...@ffconsult ancy.comwrote:
I would like to embed a high-performance native-code BLAS implementation in
a .NET DLL. What is the recommended way of doing this?

--
Dr Jon D Harrop, Flying Frog Consultancyhttp ://www.ffconsultan cy.com/products/?u
Hi,

I do not think you can do that. you will have to distribute both dlls.
Jun 27 '08 #2
Ignacio Machin ( .NET/ C# MVP ) wrote:
On Apr 28, 8:49*am, Jon Harrop <j...@ffconsult ancy.comwrote:
>I would like to embed a high-performance native-code BLAS implementation
in a .NET DLL. What is the recommended way of doing this?

--
Dr Jon D Harrop, Flying Frog
Consultancyhtt p://www.ffconsultan cy.com/products/?u

Hi,

I do not think you can do that. you will have to distribute both dlls.
Ok, thanks. Is it possible to have an optional dependency on another DLL? So
users could provide their own BLAS implementation and our DLL would use it
if available but would resort to managed code otherwise?

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #3
Jon Harrop wrote:
I would like to embed a high-performance native-code BLAS
implementation in a .NET DLL. What is the recommended way of doing
this?
C++

Specifically, C++/CLI. The native code doesn't have to be C++ though, you
can link any static library with a C++/CLI wrapper into a single mixed-mode
assembly.

Note that this is the wrong group for such things, which is why you'll get
people telling you it can't be done.
Jun 27 '08 #4
Ben Voigt [C++ MVP] wrote:
Specifically, C++/CLI. The native code doesn't have to be C++ though, you
can link any static library with a C++/CLI wrapper into a single
mixed-mode assembly.
Can I then statically link that DLL into a C# DLL?
Note that this is the wrong group for such things, which is why you'll get
people telling you it can't be done.
What is a more appropriate (language agnostic if possible) group?

Thanks,
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #5
Jon Harrop wrote:
Ben Voigt [C++ MVP] wrote:
>Specifically , C++/CLI. The native code doesn't have to be C++
though, you can link any static library with a C++/CLI wrapper into
a single mixed-mode assembly.

Can I then statically link that DLL into a C# DLL?
You said "into a .NET DLL". The C++/CLI compiler creates assemblies that
can be used from any .NET language, just as if it were a C# DLL.

You can also compile your whole program into .netmodule files and use the
C++/CLI linker to create the executable. The C# compiler hasn't any concept
of static linking though, you must use the C++/CLI linker for this even if
some of the code was compiled in C#.
>
>Note that this is the wrong group for such things, which is why
you'll get people telling you it can't be done.

What is a more appropriate (language agnostic if possible) group?

Thanks,

Jun 27 '08 #6
>Note that this is the wrong group for such things, which is why
>you'll get people telling you it can't be done.

What is a more appropriate (language agnostic if possible) group?
m.p.dotnet.lang uages.vc
m.p.dotnet.fram ework.interop
>
Thanks,

Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3520
by: Max Powers | last post by:
I've spent an interesting day searching the web for help with calling OCaml functions from a python program and have come to the newsgroup for some advice (unfortunately I'm learning both languages at the same time, so maybe I've missed something obvious!) The situation is this; I've got a large legacy program that is written in ocaml, within which there's a parser. I'd like to be able to call that parser from my python program (actually...
4
2791
by: Alicia Haumann | last post by:
I accidentally sent this to webmaster@python.org, so this could be a duplicate if "webmaster" forwards it to this list. :{ Hi, there. Thanks for any help that can be offered. I've been working with Python for a year or more now, but only doing simple extending in C/C++. I'm now attempting some embedding and several questions have come to mind. BTW - I'm running Windows 2000 with Python23 and VisualC++ developers
3
2300
by: Jim Hargrave | last post by:
I've read that it is possible to compile jython to native code using GCJ. PyLucene uses this approach, they then use SWIG to create a Python wrapper around the natively compiled (java) Lucene. Has this been done before for with jython? Another approach would be to use JPype to call the jython jar directly. My goal is to be able to script Java code using Jython - but with the twist of using Cpython as a glue layer. This would allow...
0
1119
by: adsheehan | last post by:
Hi, I am embedding Python into a multi-threaded application running on Solaris. Python will enable end users to customize and re-program many aspects of the application. I expect that the C++ application will be natively multi-threaded and will embed multiple Python sub-interpreters. Called Python scripts may in turn call back into the C++ application via SWIG wrappers of C++ objects.
1
1921
by: amit | last post by:
Hello, I am currently studying how to embedd python. I am developing a graphical C++ application. My goal is to embedd python script that will control some kind of animation. I have some questions about python embedding: 1) Is there a good text book or other resource on embedding/extending? (I find it hard to learn only by the tutorial and C/Python API from the python.org site)
1
2595
by: Bob | last post by:
I would appreciate any suggestions on handling the following... I currently have a VC++ MDI Application. The core pieces/products are all handled in separate dll's. Our shop has slowly been rewriting other applications over to VB.net. My application has now been targeted with coming over, but management does not want to incur a rewrite timeline. Since we have a standard vb.net framework in place, their thoughts are to try and take the...
0
1430
by: hq4000 | last post by:
Given AStyleSheet.xsl : <AStyleSheet> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.mytest.mytest2.mytest3.com" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:element name="Test">it works</xsl:element> </xsl:template>
6
3011
by: Qun Cao | last post by:
Hi Everyone, I am a beginner on cross language development. My problem at hand is to build a python interface for a C++ application built on top of a 3D game engine. The purpose of this python interface is providing a convenient scripting toolkit for the application. One example is that a user can write a python script like: player = Player() game.loadPlayer(player) player.moveTo(location)
0
2116
by: Tim Spens | last post by:
--- On Fri, 6/27/08, Tim Spens <t_spens@yahoo.comwrote: I think I know where the problem is but I'm unsure how to fix it. When I call Register_Handler(...) from python via callback.setHandler1(callback1) this only seems to affect pythons ability to trigger an "event" in c. PyObject *Handler is always NULL even after I call Register_Handler(...). I thought there was some magic here that was assigning the pointer *Handler to my python...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.