linux环境变量BDK,在Linux上

用户在尝试在Linux环境下使用CUDA编译OpenCV程序时遇到错误,具体表现为GCC版本4.3.5与某些头文件类型不兼容。用户提到在Windows的Visual Studio 2012下可以正常运行,但在Linux上编译失败。问题可能涉及到OpenCV版本4.3.7、CUDA 4.0和G++ 4.4之间的兼容性问题。
摘要由CSDN通过智能技术生成

OpenCV的编译支持CUDA我试图编译程序与OpenCV的Linux上的CUDA支持。我创建的Makefile:在Linux上

filtry_gpu: filtry_gpu.cu

nvcc -lopencv_highgui -lopencv_core -I/opt/opencv/include -L/opt/opencv/lib -Xcompiler \-fopenmp -Xcompiler \-Wall -Xlinker \-lgomp filtry_gpu.cu -o filtry_gpu

clean:

rm -f *.o

,但我得到的错误:

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(218): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(225): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(711): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(717): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(964): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(964): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(988): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(988): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1012): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1012): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1060): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1060): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1132): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1181): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1199): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1199): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1229): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1229): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1235): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1235): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1241): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1241): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1247): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1247): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1253): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1253): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1426): error: argument of type "__v2di *" is incompatible with parameter of type "__attribute((vector_size(16))) long *"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1426): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

我OpenCV的版本是4.3.7,CUDA 4.0,G ++ 4.4

同样的程序运行在Visual Studio 2012的罚款。有没有什么办法可以在linux上编译?

2013-12-15

John

As an AI language model, I don't have access to examples of keys or sensitive information. However, I can provide you with the general steps for generating an IPEK using BouncyCastle: 1. Generate a random 16-byte key, called the "Key Encryption Key" (KEK). 2. Using the KEK and the BDK (Base Derivation Key), generate a 16-byte key called the "Initial PIN Encryption Key" (IPEK). 3. XOR the IPEK with the first 8 bytes of the KSN (Key Serial Number) to generate the "PIN Encryption Key" (PEK). 4. XOR the IPEK with the second 8 bytes of the KSN to generate the "Data Encryption Key" (DEK). Here's the Java code using BouncyCastle: ``` import org.bouncycastle.crypto.engines.AESEngine; import org.bouncycastle.crypto.modes.CBCBlockCipher; import org.bouncycastle.crypto.params.KeyParameter; import org.bouncycastle.crypto.params.ParametersWithIV; import org.bouncycastle.util.encoders.Hex; public class IpekGenerator { private static final byte[] BDK = Hex.decode("0123456789ABCDEFFEDCBA9876543210"); private static final byte[] KSN = Hex.decode("FFFF9876543210E00001"); public static void main(String[] args) { // Generate KEK byte[] kek = new byte[16]; new SecureRandom().nextBytes(kek); // Generate IPEK byte[] ipek = generateIpek(BDK, kek); System.out.println("IPEK: " + Hex.toHexString(ipek)); // Generate PEK and DEK byte[] pek = generatePek(ipek, KSN); byte[] dek = generateDek(ipek, KSN); System.out.println("PEK: " + Hex.toHexString(pek)); System.out.println("DEK: " + Hex.toHexString(dek)); } private static byte[] generateIpek(byte[] bdk, byte[] kek) { byte[] data = new byte[16]; System.arraycopy(kek, 0, data, 0, 8); System.arraycopy(bdk, 0, data, 8, 8); CBCBlockCipher cipher = new CBCBlockCipher(new AESEngine()); ParametersWithIV params = new ParametersWithIV(new KeyParameter(bdk), new byte[16]); cipher.init(true, params); byte[] ipek = new byte[16]; cipher.processBlock(data, 0, ipek, 0); return ipek; } private static byte[] generatePek(byte[] ipek, byte[] ksn) { byte[] pek = new byte[8]; for (int i = 0; i < 8; i++) { pek[i] = (byte) (ipek[i] ^ ksn[i]); } return pek; } private static byte[] generateDek(byte[] ipek, byte[] ksn) { byte[] dek = new byte[8]; for (int i = 0; i < 8; i++) { dek[i] = (byte) (ipek[i + 8] ^ ksn[i]); } return dek; } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值